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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A240388 A sequence related to the Stern sequence s(n) (A002487), defined by w(n) = s(3n)/2. 2
0, 1, 1, 2, 1, 2, 2, 4, 1, 4, 2, 3, 2, 5, 4, 6, 1, 6, 4, 5, 2, 3, 3, 7, 2, 9, 5, 7, 4, 9, 6, 8, 1, 8, 6, 9, 4, 7, 5, 9, 2, 7, 3, 4, 3, 8, 7, 11, 2, 13, 9, 12, 5, 8, 7, 15, 4, 17, 9, 11, 6, 13, 8, 10, 1, 10, 8, 13, 6, 11, 9, 17, 4, 15, 7, 8, 5, 12, 9, 13, 2, 11, 7, 8, 3, 4, 4, 10, 3, 14, 8, 12, 7, 16, 11, 15, 2, 17, 13, 20, 9, 16, 12, 22, 5, 18, 8, 10, 7, 18, 15, 23, 4, 25, 17, 22, 9, 14, 11, 23, 6, 25, 13, 15, 8, 17, 10, 12, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

The even terms in the Stern sequence, divided by 2.

REFERENCES

J. Lansing, On the Stern sequence and a related sequence, PhD dissertation, University of Illinois, 2014.

J. Lansing, Largest Values for the Stern Sequence, J. Integer Seqs., 17 (2014), #14.7.5.

LINKS

Table of n, a(n) for n=0..128.

J. Lansing, On the Stern sequence and a related sequence, Joint Mathematics Meetings, Baltimore, 2014.

Jennifer Lansing, Dissertation: On the Stern sequence and a related sequence.

FORMULA

w(0)=0, w(1)=1, and w(3)=2.  For n >= 1, w(n) satisfies the recurrences

w(2n)=w(n),

w(8n +/- 1)=w(4n +/- 1) + 2w(n),

w(8n +/- 3)=w(4n +/- 1) + w(2n +/- 1) -w(n).

EXAMPLE

w(7)=w(8-1)=w(3)+2w(1)=2+2=4.

w(11)=w(8+3)=w(4+1)+w(2+1)-w(1)=w(5)+w(3)-w(1)=2+2-1=3.

Comment from N. J. A. Sloane, Jul 01 2014: May be arranged as a triangle:

0

1

1

2 1 2

2 4 1 4 2

3 2 5 4 6 1 6 4 5 2 3

3 7 2 9 5 7 4 9 6 8 1 8 6 9 4 7 5 9 2 7 3

...

MAPLE

A240388 := proc(n)

    option remember;

    local nloc;

    if n <=1  then

        n;

    elif n = 3 then

        2;

    elif type(n, 'even') then

        procname(n/2) ;

    elif modp(n, 8) = 1 then

        nloc := (n-1)/8 ;

        procname(4*nloc+1)+2*procname(nloc) ;

    elif modp(n, 8) = 7 then

        nloc := (n+1)/8 ;

        procname(4*nloc-1)+2*procname(nloc) ;

    elif modp(n, 8) = 3 then

        nloc := (n-3)/8 ;

        procname(4*nloc+1)+procname(2*nloc+1)-procname(nloc) ;

    else

        nloc := (n+3)/8 ;

        procname(4*nloc-1)+procname(2*nloc-1)-procname(nloc) ;

    end if;

end proc: # R. J. Mathar, Jul 05 2014

MATHEMATICA

Clear[s]; s[0] = 0; s[1] = 1; s[n_?EvenQ] := s[n] = s[n/2];

s[n_?OddQ] :=

s[n] = s[(n + 1)/2] + s[(n - 1)/2] (* For the Stern sequence *)

Clear[w]; w[n_] = 1/2 s[3 n]

PROG

a(n)=my(a=1, b=0); n*=3; while(n>0, if(n%2, b+=a, a+=b); n>>=1); b/2 \\ Charles R Greathouse IV, May 27 2014

CROSSREFS

Cf. A002487.

Sequence in context: A062790 A046640 A347101 * A049823 A143775 A244329

Adjacent sequences:  A240385 A240386 A240387 * A240389 A240390 A240391

KEYWORD

nonn,easy

AUTHOR

Jennifer Lansing, Apr 04 2014

STATUS

approved

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 December 1 16:44 EST 2021. Contains 349430 sequences. (Running on oeis4.)