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.

Showing 1-2 of 2 results.

A290730 Analog of A084848, replacing "quadratic residue" (X^2) with "value of X(3X-1)/2". a(n) = A290732(A290729(n)).

Original entry on oeis.org

1, 3, 4, 6, 7, 9, 10, 12, 11, 12, 18, 21, 24, 28, 36, 40, 42, 44, 66, 77, 72, 84, 108, 120, 126, 162, 168, 216, 240, 252, 280, 264, 308, 396, 440, 462, 594, 504, 648, 720, 756, 840, 1008, 1080, 1134, 1260, 1512, 1512, 1680, 2016
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a290732[n_] := Product[{p, e} = pe; If[p <= 3, p^e, (p^e - p^(e-1))/2 + (p^(e-1) - p^(Mod[e+1, 2]))/(2*(p+1))+1], {pe, FactorInteger[n]}];
    r = 2; Reap[For[j = 1, j <= 24001, j = j+1, w = a290732[j]; t = w/j; If[t < r, r = t; Sow[w]]]][[2, 1]] (* Jean-François Alcover, Oct 03 2018, after Hugo Pfoertner *)
  • PARI
    a290732(n)={my(f=factor(n));prod(k=1,#f~,my([p,e]=f[k, ]); if(p<=3,p^e,(p^e-p^(e-1))/2+(p^(e-1)-p^((e+1)%2))/(2*(p+1))+1))}
    my(r=2);for(j=1,24001,my(w=a290732(j),t=w/j);if(tHugo Pfoertner, Aug 26 2018

Extensions

More terms from Hugo Pfoertner, Aug 23 2018
a(1), a(19) and a(38) corrected by Hugo Pfoertner, Aug 26 2018

A290732 Number of distinct values of X*(3*X-1)/2 mod n.

Original entry on oeis.org

1, 2, 3, 4, 3, 6, 4, 8, 9, 6, 6, 12, 7, 8, 9, 16, 9, 18, 10, 12, 12, 12, 12, 24, 11, 14, 27, 16, 15, 18, 16, 32, 18, 18, 12, 36, 19, 20, 21, 24, 21, 24, 22, 24, 27, 24, 24, 48, 22, 22, 27, 28, 27, 54, 18, 32, 30, 30, 30, 36
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2017

Keywords

Examples

			The values taken by (3*X^2-X)/2 mod n for small n are:
   1, [0]
   2, [0, 1]
   3, [0, 1, 2]
   4, [0, 1, 2, 3]
   5, [0, 1, 2]
   6, [0, 1, 2, 3, 4, 5]
   7, [0, 1, 2, 5]
   8, [0, 1, 2, 3, 4, 5, 6, 7]
   9, [0, 1, 2, 3, 4, 5, 6, 7, 8]
  10, [0, 1, 2, 5, 6, 7]
  11, [0, 1, 2, 4, 5, 7]
  12, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  ...
		

Crossrefs

Cf. A000224 (analog for X^2), A014113, A290729, A290730, A290731, A317623.

Programs

  • Maple
    a:=[]; M:=80;
    for n from 1 to M do
    q1:={};
    for i from 0 to 2*n-1 do q1:={op(q1), i*(3*i-1)/2 mod n}; od;
    s1:=sort(convert(q1,list));
    a:=[op(a),nops(s1)];
    od:
    a;
  • Mathematica
    a[n_] := Table[PolynomialMod[X(3X-1)/2, n], {X, 0, 2*n-1}]// Union // Length;
    Array[a, 60] (* Jean-François Alcover, Sep 01 2018 *)
  • PARI
    a(n)={my(v=vector(n)); for(i=0, 2*n-1, v[i*(3*i-1)/2%n + 1]=1); vecsum(v)} \\ Andrew Howroyd, Oct 27 2018
    
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); if(p<=3, p^e, 1 + p^(e+1)\(2*p+2)))} \\ Andrew Howroyd, Nov 03 2018

Formula

a(3^n) = 3^n. - Hugo Pfoertner, Aug 25 2018
a(n) = A317623(n) * A040001(n). - Andrew Howroyd, Oct 27 2018
Multiplicative with a(2^e) = 2^e, a(3^e) = 3^e, a(p^e) = 1 + floor( p^(e+1)/(2*p+2) ) for prime p >= 5. - Andrew Howroyd, Nov 03 2018

Extensions

Even terms corrected by Andrew Howroyd, Nov 03 2018
Showing 1-2 of 2 results.