login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268131 If a(n) is not squarefree, then a(n+1) = a(n) + a(n-1), else a(n+1) is the smallest positive integer not occurring earlier. 1
1, 2, 3, 4, 7, 5, 6, 8, 14, 9, 23, 10, 11, 12, 23, 13, 15, 16, 31, 17, 18, 35, 19, 20, 39, 21, 22, 24, 46, 25, 71, 26, 27, 53, 28, 81, 109, 29, 30, 32, 62, 33, 34, 36, 70, 37, 38, 40, 78, 41, 42, 43, 44, 87, 45, 132, 177, 47, 48, 95, 49, 144, 193, 50, 243 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
A variant of the sequence A267758 where the relation has to hold for prime numbers rather than for squarefree numbers. In contrast to that sequence we have many "lines" here (when the property occurs for consecutive terms), roughly proportional to n, 2n, 3n, ... Here we also have duplicate terms (which we could exclude explicitly), for n <= 1000 this happens 19 times.
LINKS
PROG
(PARI) {a(n, show=0, is=x->issquarefree(x), a=[1], L=0, U=[])->while(#a<n, show&&if(type(show)=="t_STR", write(show, #a, " ", a[#a]), print1(a[#a]", ")); if(a[#a]>L+1, U=setunion(U, [a[#a]]), L++; while(#U&&U[1]<=L+1, U=U[^1]; L++)); a=concat(a, if(is(a[#a]), L+1, a[#a]+a[#a-1]))); if(type(show)=="t_VEC", a, a[#a])}
CROSSREFS
Sequence in context: A071665 A071662 A125978 * A361646 A359051 A014321
KEYWORD
nonn,look
AUTHOR
M. F. Hasler, Jan 26 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 02:53 EDT 2024. Contains 371906 sequences. (Running on oeis4.)