login
a(1) = a(2) = 1, a(3) = 2, a(4) = 3, a(5) = 5, a(6) = a(7) = 6, a(8) = 7; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) + a(n-a(n-4)) for n > 8.
1

%I #21 Sep 08 2022 08:46:21

%S 1,1,2,3,5,6,6,7,8,9,11,11,10,12,13,16,15,14,16,17,20,19,17,20,23,22,

%T 23,23,24,25,26,27,27,27,29,30,31,32,30,33,35,34,34,37,38,37,36,42,38,

%U 40,42,41,45,41,43,47,48,48,49,43,45,53,52,58,44,48,54,58

%N a(1) = a(2) = 1, a(3) = 2, a(4) = 3, a(5) = 5, a(6) = a(7) = 6, a(8) = 7; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) + a(n-a(n-4)) for n > 8.

%C This sequence is well defined for n = 1..1000000000; however, it is not known if this sequence is defined for all positive n.

%H Rémy Sigrist, <a href="/A309560/b309560.txt">Table of n, a(n) for n = 1..10000</a>

%H Rémy Sigrist, <a href="/A309560/a309560.png">Density plot of the first 10000000 terms</a>

%H Rémy Sigrist, <a href="/A309560/a309560.txt">C++ program to search for this type of sequences</a>

%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>

%e a(10) = a(10-a(9)) + a(10-a(8)) + a(10-a(7)) + a(10-a(6)) = a(10-8) + a(10-7) + a(10-6) + a(10-6) = a(2) + a(3) + a(4) + a(4) = 1 + 2 + 3 + 3 = 9.

%o (PARI) a = vector(68); a[1] = a[2] = 1; a[3] = 2; a[4] = 3; a[5] = 5; a[6] = a[7] = 6; a[8] = 7; for (n=9, #a, a[n] = a[n-a[n-1]] + a[n-a[n-2]] + a[n-a[n-3]] + a[n-a[n-4]]); print (a)

%o (Magma) I:=[1,1,2,3,5,6,6,7];[n le 8 select I[n] else Self(n-Self(n-1))+Self(n-Self(n-2))+Self(n-Self(n-3)) + Self(n-Self(n-4)): n in [1..70]]; // _Marius A. Burtea_, Aug 07 2019

%Y Cf. A005185, A292351.

%K nonn,look

%O 1,3

%A _Altug Alkan_ and _Rémy Sigrist_, Aug 07 2019