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.

This page as a plain text file.
%I A002704 M2146 N0855 #47 Oct 19 2023 08:48:54
%S A002704 2,26,938,42800,2130458,111557594,6041272682,335089258634,
%T A002704 18922687509962,1083572842675610,62744027461625648,
%U A002704 3666433604712457466,215879610645469496234,12792865816027823374874,762278349313657804740842,45638342462133835019322554
%N A002704 Number of sets with a congruence property.
%D A002704 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A002704 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A002704 Alexander Rosa and Štefan Znám, <a href="/A002703/a002703.pdf">A combinatorial problem in the theory of congruences (Russian with English summary)</a>, Mat.-Fys. Casopis Sloven. Akad. Vied 15 1965 49-59. [Annotated scanned copy.]
%H A002704 Alexander Rosa and Štefan Znám, <a href="/A002703/a002703_1.pdf">A remark on a combinatorial problem (Russian with English summary)</a>, Mat.-Fyz. Casopis Sloven. Akad. Vied 15 1965 313-316. [Annotated scanned copy]. See Table 3 on page 316.
%F A002704 See Maple code!
%p A002704 p := proc(r,s,k)
%p A002704     option remember;
%p A002704     if r = 0 then
%p A002704         1;
%p A002704     elif r < 0 then
%p A002704         0;
%p A002704     elif s < 0 then
%p A002704         0;
%p A002704     elif igcd(s,2*k+1) > 1 then
%p A002704         procname(r,s-1,k) ;
%p A002704     else
%p A002704         procname(r,s-1,k)+procname(r-s,s-1,k) ;
%p A002704     end if;
%p A002704 end proc:
%p A002704 Q := proc(n,k)
%p A002704     local q,knrat,alpha,m ;
%p A002704     q := 0 ;
%p A002704     knrat := (2*k*n^2+n^2+k^2)/4/k ;
%p A002704     if type(knrat,'integer') then
%p A002704         for alpha from 0 to knrat do
%p A002704             m := 2*n+n/k ;
%p A002704             if modp(2*alpha,m) = modp(knrat,m) then
%p A002704                 q := q+p(alpha,n+(n-k)/2/k,k) ;
%p A002704             end if;
%p A002704         end do:
%p A002704     end if;
%p A002704     q ;
%p A002704 end proc:
%p A002704 A002704 := proc(n)
%p A002704     nloc := 3+6*n ;
%p A002704     Q(nloc,3) ;
%p A002704 end proc:
%p A002704 seq(A002704(n),n=0..15) ; # _R. J. Mathar_, Oct 21 2015
%t A002704 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]];
%t A002704 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];
%t A002704 a[n_] := Q[6 n + 3, 3];
%t A002704 a /@ Range[0, 15] (* _Jean-François Alcover_, Mar 27 2020, after _R. J. Mathar_ *)
%Y A002704 Cf. A002703, A002705, A262570, A262583, A262584.
%K A002704 nonn
%O A002704 0,1
%A A002704 _N. J. A. Sloane_
%E A002704 More terms from _R. J. Mathar_, Oct 21 2015