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.

A002705 Sets with a congruence property.

This page as a plain text file.
%I A002705 M3673 N1497 #40 Oct 20 2023 12:34:04
%S A002705 0,4,40,468,5828,76260,1032444,14316584,202116108,2893451652,
%T A002705 41886157564,611902123284,9007199254740,133439988963012,
%U A002705 1987795697598012,29752813022112180,447193795726343004,6746237832670921768,102105221251235572188
%N A002705 Sets with a congruence property.
%C A002705 The values for k=1, Q(n,1) in table 1 on page 315 for n = 3,5,7,9,... are 0, 2, 6, 18, 62, 210, 728, 2570, 9198, 33288, 121574, 447394, 1657008, 6170930, 23091222, 86767016, 327235610, 1238188770, 4698767640 ... (see A262590), - _R. J. Mathar_, Oct 21 2015
%D A002705 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A002705 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A002705 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 A002705 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 2.
%F A002705 See Maple code!
%p A002705 p := proc(r,s,k)
%p A002705     option remember;
%p A002705     if r = 0 then
%p A002705         1;
%p A002705     elif r < 0 then
%p A002705         0;
%p A002705     elif s < 0 then
%p A002705         0;
%p A002705     elif igcd(s,2*k+1) > 1 then
%p A002705         procname(r,s-1,k) ;
%p A002705     else
%p A002705         procname(r,s-1,k)+procname(r-s,s-1,k) ;
%p A002705     end if;
%p A002705 end proc:
%p A002705 Q := proc(n,k)
%p A002705     local q,knrat,alpha,m ;
%p A002705     q := 0 ;
%p A002705     knrat := (2*k*n^2+n^2+k^2)/4/k ;
%p A002705     if type(knrat,'integer') then
%p A002705         for alpha from 0 to knrat do
%p A002705             m := 2*n+n/k ;
%p A002705             if modp(2*alpha,m) = modp(knrat,m) then
%p A002705                 q := q+p(alpha,n+(n-k)/2/k,k) ;
%p A002705             end if;
%p A002705         end do:
%p A002705     end if;
%p A002705     q ;
%p A002705 end proc:
%p A002705 A002705 := proc(n)
%p A002705     nloc := 2+4*n ;
%p A002705     Q(nloc,2) ;
%p A002705 end proc: # _R. J. Mathar_, Oct 21 2015
%t A002705 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 A002705 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 A002705 a[n_] := Q[4 n + 2, 2];
%t A002705 a /@ Range[0, 18] (* _Jean-François Alcover_, Mar 27 2020, after _R. J. Mathar_ *)
%Y A002705 Cf. A002703, A002704, A262585, A262590.
%K A002705 nonn
%O A002705 0,2
%A A002705 _N. J. A. Sloane_
%E A002705 More terms from _R. J. Mathar_, Oct 21 2015