login
The difference between n and the largest term of A086893 <= n.
3

%I #4 Apr 29 2024 09:07:02

%S 0,1,0,1,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,8,9,10,11,12,

%T 13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,0,1,2,3,4,5,

%U 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,0,1,2,3,4,5,6

%N The difference between n and the largest term of A086893 <= n.

%o (PARI)

%o A086893(n) = (if(n%2, 2^(n+1), 2^(n+1)+2^(n-1))\3); \\ From A086893

%o A372352(n) = { my(k); for(i=1,oo,k=A086893(i); if(k>n, return(n-A086893(i-1)))); };

%Y Cf. A086893, A096773, A372353.

%Y Cf. also A372286.

%K nonn,easy

%O 1,7

%A _Antti Karttunen_ (proposed by _Ali Sada_), Apr 29 2024