Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #22 Apr 06 2023 02:34:39
%S 1,1,1,1,2,3,4,4,6,7,8,9,10,11,12,13,14,15,16,16,18,18,19,20,21,21,22,
%T 23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
%U 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24
%N a(n) = A000720(Sum_{j=1..4} a(n-j)) with a(1)=a(2)=a(3)=a(4)=1.
%C 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?
%C a(n) = 24 for 30 <= n <= 10^7. - _G. C. Greubel_, Apr 06 2023
%H G. C. Greubel, <a href="/A100476/b100476.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).
%e a(6) = A000720(a(2)+a(3)+a(4)+a(5)) = A000720(5) = 3.
%t a={1,1,1,1}; Do[ AppendTo[a,PrimePi[a[[-1]]+a[[-2]]+a[[-3]]+a[[-4]]]], {70}]; a
%t 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 *)
%o (SageMath)
%o @CachedFunction
%o def a(n): # a = A100476
%o if (n<5): return 1
%o else: return prime_pi( sum(a(n-j) for j in range(1,5)) )
%o [a(n) for n in range(1,81)] # _G. C. Greubel_, Apr 06 2023
%Y Cf. A000720, A100478.
%K easy,nonn
%O 1,5
%A _Jonathan Vos Post_, Nov 22 2004
%E Edited by _Stefan Steinerberger_, Aug 08 2007