version 1.0.0 (1.62 KB) by rewanth nayak
A133058 Neil Sloane himself explaining this sequ


Updated 19 Jun 2022

View License

Neil Sloane himself explaining this sequence wrote this simple matlab code after wathching this numberphile video
function fly_stright(n)
% A133058
%a(0) = a(1) = 1;
%for n > 1, a(n) = a(n-1) + n + 1
%if a(n-1) and n are coprime,
%otherwise a(n) = a(n-1)/gcd(a(n-1),n).
A=[1,1]; %initialising
for i = 2:n
if gcd(i,A(i)) == 1
%if no comman factor a(n)= a(n-1)+n+1
A(i+1) = A(i)+i+1;
else %a(n)=a(n-1)/gcd(n,a(n-1))
A(i+1) = A(i)/gcd(i,A(i));
x=1:length(A); %vector for plotting
neil sloane named it fly stright after the scene in avatar where jake scully tried to fly banshee, and coudn't fly it properly until a point.

Cite As

rewanth nayak (2022). fly_stright (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!