OFFSET
1,6
COMMENTS
Starting with other values of a(1), a(2), a(3), a(4), a(5) what behaviors are possible? Does the sequence always stick at a single integer after some point, or can it go into a loop, or is there a third pattern?
a(n) is equal to 66 for 54 <= n <= 10^7. - G. C. Greubel, Apr 06 2023
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Andrew Booker, The Nth Prime Page.
I. Flores, k-Generalized Fibonacci numbers, Fib. Quart., 5 (1967), 258-266.
V. E. Hoggatt, Jr. and M. Bicknell, Diagonal sums of generalized Pascal triangles, Fib. Quart., 7 (1969), 341-358, 393.
Eric Weisstein's World of Mathematics, Prime Counting Function
FORMULA
a(n) = pi(a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5)) with a(1) = a(2) = a(3) = a(4) = a(5) = 1.
EXAMPLE
a(6) = pi(a(1)+a(2)+a(3)+a(4)+a(5)) = pi(1+1+1+1+1) = pi(5) = 3.
a(7) = pi(a(2)+a(3)+a(4)+a(5)+a(6)) = pi(1+1+1+1+3) = pi(7) = 4.
a(8) = pi(a(3)+a(4)+a(5)+a(6)+a(7)) = pi(1+1+1+3+4) = pi(10) = 4.
a(9) = pi(a(4)+a(5)+a(6)+a(7)+a(8)) = pi(1+1+3+4+4) = pi(13) = 6.
a(10) = pi(a(5)+a(6)+a(7)+a(8)+a(9)) = pi(1+3+4+4+6) = pi(18) = 7.
MATHEMATICA
a[n_]:= a[n]= If[n<6, 1, PrimePi[Sum[a[n-j], {j, 5}]]];
Table[a[n], {n, 80}] (* Robert G. Wilson v, Dec 03 2004 *)
PROG
(SageMath)
@CachedFunction
def a(n): # a = A100478
if (n<6): return 1
else: return prime_pi(sum(a(n-j) for j in range(1, 6)))
[a(n) for n in range(1, 81)] # G. C. Greubel, Apr 06 2023
CROSSREFS
KEYWORD
easy,nonn,changed
AUTHOR
Jonathan Vos Post, Nov 22 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Dec 03 2004
STATUS
approved