OFFSET
1,5
COMMENTS
For n > 29 we have a(n) = 24. Starting with other values of a(1), a(2), a(3), a(4) what behaviors are possible? The sequence is in any case bounded. If for some k a(k) + a(k+1) + a(k+2) + a(k+3) > 400, then a(k+4) is smaller than the average of a(k), a(k+1), a(k+2) and a(k+3), which means that the sequence will always stick at a single integer after some point or go into a loop. Are there values a(1), a(2), a(3), a(4) such that the sequence would indeed exhibit cyclic behavior?
a(n) = 24 for 30 <= n <= 10^7. - G. C. Greubel, Apr 06 2023
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1).
MATHEMATICA
a={1, 1, 1, 1}; Do[ AppendTo[a, PrimePi[a[[-1]]+a[[-2]]+a[[-3]]+a[[-4]]]], {70}]; a
RecurrenceTable[{a[1]==a[2]==a[3]==a[4]==1, a[n]==PrimePi[a[n-1]+ a[n-2]+ a[n-3]+a[n-4]]}, a[n], {n, 80}] (* Harvey P. Dale, Sep 19 2011 *)
PROG
(SageMath)
@CachedFunction
def a(n): # a = A100476
if (n<5): return 1
else: return prime_pi( sum(a(n-j) for j in range(1, 5)) )
[a(n) for n in range(1, 81)] # G. C. Greubel, Apr 06 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Nov 22 2004
EXTENSIONS
Edited by Stefan Steinerberger, Aug 08 2007
STATUS
approved