cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A046630 Number of cubic residues mod 2^n.

Original entry on oeis.org

1, 2, 3, 5, 10, 19, 37, 74, 147, 293, 586, 1171, 2341, 4682, 9363, 18725, 37450, 74899, 149797, 299594, 599187, 1198373, 2396746, 4793491, 9586981, 19173962, 38347923, 76695845, 153391690, 306783379, 613566757, 1227133514, 2454267027
Offset: 0

Views

Author

Keywords

Examples

			For n=3, the cubes 0^3, 1^3, 2^3, ..., 7^3 reduced mod 2^3 = 8 are 0,1,0,3,0,5,0,7, five different values, so a(3)=5. - _N. J. A. Sloane_, Sep 30 2018
		

Crossrefs

Cf. A033138.

Programs

  • Maple
    A049347 := proc(n) op( (n mod 3)+1,[1,-1,0]) ;end proc:
    A046630 := proc(n) 2^(n+2)/7+2/3-(5*A049347(n)+A049347(n-1))/21 ; end proc: # R. J. Mathar, Feb 27 2011
  • Mathematica
    LinearRecurrence[{2, 0, 1, -2}, {1, 2, 3, 5}, 33] (* Jean-François Alcover, Nov 17 2017 *)
  • PARI
    a(n)=(4<Charles R Greathouse IV, Jan 03 2013

Formula

a(n) = ceiling(2^(n+2)/7) [Finch-Sebah, page 12]. - N. J. A. Sloane, Sep 30 2018
G.f.: (-2*x^3-x^2+1)/((1-2*x)*(1-x^3)).
a(n) = A046530(2^n) = 2^(n+2)/7 + 2/3 - (5*A049347(n)+A049347(n-1))/21. - R. J. Mathar, Feb 27 2011
a(n) = 1 + A033138(n) for n >= 1. - John Keith, Mar 07 2022