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-5 of 5 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

A290731 Number of distinct values of X*(X+1) mod n.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 4, 4, 4, 3, 6, 4, 7, 4, 6, 8, 9, 4, 10, 6, 8, 6, 12, 8, 11, 7, 11, 8, 15, 6, 16, 16, 12, 9, 12, 8, 19, 10, 14, 12, 21, 8, 22, 12, 12, 12, 24, 16, 22, 11, 18, 14, 27, 11, 18, 16, 20, 15, 30, 12, 31, 16, 16, 32, 21, 12, 34, 18, 24, 12, 36, 16, 37, 19, 22, 20, 24, 14, 40, 24
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2017

Keywords

Comments

Also the number of distinct values of X^2+X+1 mod n. - N. J. A. Sloane, Oct 05 2024

Examples

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

Crossrefs

Cf. A000224 (analog for X^2), A290732.

Programs

  • Maple
    a:=[]; M:=80;
    for n from 1 to M do
    q1:={};
    for i from 0 to n-1 do q1:={op(q1), (i^2+i) mod n}; od;
    s1:=sort(convert(q1,list));
    a:=[op(a),nops(s1)];
    od:
    a;
  • Mathematica
    a[n_] := Product[{p, e} = pe; If[p==2, 2^(e-1), 1+Quotient[p^(e+1), (2p+2)]], {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, Aug 05 2018, after Andrew Howroyd *)
  • PARI
    a(n)={my(v=vector(n)); for(i=0, n-1, v[i*(i+1)%n + 1]=1); vecsum(v)} \\ Andrew Howroyd, Aug 01 2018
    
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); if(p==2, 2^(e-1), 1 + p^(e+1)\(2*p+2)))} \\ Andrew Howroyd, Aug 01 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A290731(n): return prod((p**(e+1)//(p+(q:=p>2))>>1)+q for p, e in factorint(n).items()) # Chai Wah Wu, Oct 07 2024

Formula

Multiplicative with a(2^e) = 2^(e-1), a(p^2) = 1 + floor(p^(e+1)/(2*p+2)) for odd prime p. - Andrew Howroyd, Aug 01 2018

A014113 a(n) = a(n-1) + 2*a(n-2) with a(0)=0, a(1)=2.

Original entry on oeis.org

0, 2, 2, 6, 10, 22, 42, 86, 170, 342, 682, 1366, 2730, 5462, 10922, 21846, 43690, 87382, 174762, 349526, 699050, 1398102, 2796202, 5592406, 11184810, 22369622, 44739242, 89478486, 178956970, 357913942, 715827882, 1431655766, 2863311530, 5726623062, 11453246122
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a014113 n = a014113_list !! n
    a014113_list = 0 : 2 : zipWith (+)
                           (map (* 2) a014113_list) (tail a014113_list)
    -- Reinhard Zumkeller, Jul 20 2013
  • Mathematica
    LinearRecurrence[{1,2},{0,2},50] (* Vincenzo Librandi, Feb 19 2012 *)

Formula

a(0) = 0 and if n>=1, a(n) = 2^n - a(n-1).
a(n) = A078008(n+1). - Reinhard Zumkeller, Jun 10 2005
a(n) = 2*A001045(n). - Benoit Jubin, Dec 01 2011
a(n) = (2^(n+1) - 2*(-1)^n)/3. - Ralf Stephan, Jul 18 2013
G.f.: 2*x/(1+x)/(1-2*x). - Colin Barker, Feb 19 2012
G.f.: 1/Q(0) -1, where Q(k) = 1 + 2*x^2 - (2*k+3)*x + x*(2*k+1 - 2*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 05 2013
Consider a Pascal-like triangle T(n,k) in which T(n,0) = T(n,n) = 0 if n even, 1 if n odd, and each interior entry T(n,k) is the sum of the two entries "above" it: T(n,k) = T(n-1,k-1) + T(n-1,k) for 0 < k < n. Then, a(n) is the sum of the entries in the n-th row of T(n,k). - Greg Dresden, May 24 2024

A290729 Analog of A085635, replacing "quadratic residue" (X^2) with "value of X(3X-1)/2".

Original entry on oeis.org

1, 5, 7, 11, 13, 17, 19, 23, 25, 35, 55, 65, 77, 91, 119, 133, 143, 175, 275, 325, 385, 455, 595, 665, 715, 935, 1001, 1309, 1463, 1547, 1729, 1925, 2275, 2975, 3325, 3575, 4675, 5005, 6545, 7315, 7735, 8645
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2017

Keywords

Comments

Positions k where R(k) = A290732(k)/k, achieves a new minimum.

Crossrefs

Programs

  • Mathematica
    a[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 <= 10^4, j = j+1, t = a[j]/j; If[tJean-François Alcover, Oct 02 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,10001,my(t=a290732(j)/j);if(tHugo Pfoertner, Aug 26 2018

Extensions

a(1) corrected by Hugo Pfoertner, Aug 26 2018

A317623 Number of distinct values of X*(3*X-1) mod n.

Original entry on oeis.org

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

Views

Author

Andrew Howroyd, Aug 01 2018

Keywords

Crossrefs

Programs

  • Mathematica
    f[2, e_] := 2^(e-1); f[3, e_] := 3^e; f[p_, e_] := 1 + Floor[p^(e+1)/(2*p+2)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 13 2020 *)
  • PARI
    a(n)={my(v=vector(n)); for(i=0, n-1, v[i*(3*i-1)%n + 1]=1); vecsum(v)}
    
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); if(p<=3, if(p==2, 2^(e-1), 3^e), 1 + p^(e+1)\(2*p+2)))}

Formula

Multiplicative with a(2^e) = 2^(e-1), a(3^e) = 3^e, a(p^e) = 1 + floor( p^(e+1)/(2*p+2) ) for prime p >= 5.
Showing 1-5 of 5 results.