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.

A002704 Number of sets with a congruence property.

Original entry on oeis.org

2, 26, 938, 42800, 2130458, 111557594, 6041272682, 335089258634, 18922687509962, 1083572842675610, 62744027461625648, 3666433604712457466, 215879610645469496234, 12792865816027823374874, 762278349313657804740842, 45638342462133835019322554
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    p := proc(r,s,k)
        option remember;
        if r = 0 then
            1;
        elif r < 0 then
            0;
        elif s < 0 then
            0;
        elif igcd(s,2*k+1) > 1 then
            procname(r,s-1,k) ;
        else
            procname(r,s-1,k)+procname(r-s,s-1,k) ;
        end if;
    end proc:
    Q := proc(n,k)
        local q,knrat,alpha,m ;
        q := 0 ;
        knrat := (2*k*n^2+n^2+k^2)/4/k ;
        if type(knrat,'integer') then
            for alpha from 0 to knrat do
                m := 2*n+n/k ;
                if modp(2*alpha,m) = modp(knrat,m) then
                    q := q+p(alpha,n+(n-k)/2/k,k) ;
                end if;
            end do:
        end if;
        q ;
    end proc:
    A002704 := proc(n)
        nloc := 3+6*n ;
        Q(nloc,3) ;
    end proc:
    seq(A002704(n),n=0..15) ; # R. J. Mathar, Oct 21 2015
  • Mathematica
    p[r_, s_, k_] := p[r, s, k] = Which[r == 0, 1, r < 0, 0, s < 0, 0, GCD[s, 2 k + 1] > 1, p[r, s - 1, k], True, p[r, s - 1, k] + p[r - s, s - 1, k]];
    Q[n_, k_] := Module[{q = 0, knrat, alpha, m}, knrat = (2 k n^2 + n^2 + k^2)/4/k; If[IntegerQ[knrat], For[alpha = 0, alpha <= knrat, alpha++, m = 2 n + n/k; If[Mod[2 alpha, m] == Mod[knrat, m], q += p[alpha, n + (n - k)/2/k, k]]]]; q];
    a[n_] := Q[6 n + 3, 3];
    a /@ Range[0, 15] (* Jean-François Alcover, Mar 27 2020, after R. J. Mathar *)

Formula

See Maple code!

Extensions

More terms from R. J. Mathar, Oct 21 2015