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.

A039304 Number of distinct quadratic residues mod 7^n.

Original entry on oeis.org

1, 4, 22, 151, 1051, 7354, 51472, 360301, 2522101, 17654704, 123582922, 865080451, 6055563151, 42388942054, 296722594372, 2077058160601, 14539407124201, 101775849869404, 712430949085822, 4987016643600751, 34909116505205251
Offset: 0

Views

Author

Keywords

Comments

Number of distinct n-digit suffixes of base 7 squares.

Crossrefs

Cf. A000224, A000420 (7^n).

Programs

  • Magma
    [Floor((7^n+3)*7/16): n in [0..25]]; // Vincenzo Librandi, May 14 2011
    
  • Magma
    I:=[1, 4, 22]; [n le 3 select I[n] else 7*Self(n-1)+Self(n-2)-7*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Apr 21 2012
  • Maple
    A039304 := proc(n)
        floor((7^n+3)*7/16) ;
    end proc:
    seq(A039304(n),n=0..10) ; # R. J. Mathar, Sep 28 2017
  • Mathematica
    CoefficientList[Series[(1-3*x-7*x^2)/((1-x)*(1+x)*(1-7*x)),{x,0,40}],x] (* Vincenzo Librandi, Apr 21 2012 *)
    LinearRecurrence[{7,1,-7},{1,4,22},30] (* Harvey P. Dale, Aug 03 2016 *)

Formula

a(n) = floor( (7^n + 3)*7/16 ).
G.f.: (1 - 3*x - 7*x^2)/((1-x)*(1+x)*(1-7*x)). - Colin Barker, Mar 08 2012
a(n) = 7*a(n-1) + a(n-2) - 7*a(n-3). - Vincenzo Librandi, Apr 21 2012
a(n) = A000224(7^n). - R. J. Mathar, Sep 28 2017