login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317854 Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n)) where t = A287422. a(n) = 2*b(n) - n. 4

%I

%S 1,0,-1,0,1,0,1,0,-1,0,-1,-2,-1,0,-1,0,1,0,1,2,3,2,1,2,1,2,3,2,1,0,1,

%T 0,-1,0,-1,-2,-3,-4,-3,-2,-1,-2,-3,-2,-3,-4,-5,-6,-5,-4,-3,-2,-3,-2,

%U -1,-2,-3,-4,-3,-2,-1,0,-1,0,1,0,1,2,3,4,5,4,3,2,1,2,3,4,5,4,5,6,7,8,9,10,9,8,7,6,5,4,3,4,5

%N Let b(1) = b(2) = 1; for n >= 3, b(n) = n - b(t(n)) - b(n-t(n)) where t = A287422. a(n) = 2*b(n) - n.

%C A different version of A317742. Similar to A317754.

%H Altug Alkan, <a href="/A317854/b317854.txt">Table of n, a(n) for n = 1..32768</a>

%H Altug Alkan, <a href="/A317854/a317854.png">Line plot of a(n) for n <= 2^17</a>

%H Rémy Sigrist, <a href="/A317854/a317854.txt">C++ program for A317854</a>

%F abs(a(n)) = A317742(n).

%p t:= proc(n) option remember; `if`(n<3, 1,

%p n -t(t(n-1)) -t(n-t(n-1)))

%p end:

%p b:= proc(n) option remember; `if`(n<3, 1,

%p n -b(t(n)) -b(n-t(n)))

%p end:

%p seq(2*b(n)-n, n=1..100); # after _Alois P. Heinz_ at A317686

%t t[1]=t[2]=1; t[n_] := t[n] = n - t[t[n-1]] - t[n - t[n-1]]; b[1]=b[2]=1; b[n_] := b[n] = n - b[t[n]] - b[n - t[n]]; a[n_] := 2*b[n] - n; Array[a, 95] (* _Giovanni Resta_, Aug 14 2018 *)

%o (PARI) t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = n-t[n-t[n-1]]-t[t[n-1]]); b=vector(99); b[1]=b[2]=1; for(n=3, #b, b[n] = n-b[t[n]]-b[n-t[n]]); vector(99, k, 2*b[k]-k)

%o (C++) See Links section.

%Y Cf. A287422, A317742, A317754.

%K sign,look,hear

%O 1,12

%A _Altug Alkan_, Aug 09 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 23 18:45 EDT 2021. Contains 345402 sequences. (Running on oeis4.)