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.

Previous Showing 21-30 of 31 results. Next

A376757 Number of pairs 0 <= x <= y <= n-1 such that x^3 == y^3 (mod n).

Original entry on oeis.org

1, 2, 3, 5, 5, 6, 13, 14, 18, 10, 11, 15, 25, 26, 15, 28, 17, 36, 37, 25, 39, 22, 23, 42, 35, 50, 81, 71, 29, 30, 61, 72, 33, 34, 65, 99, 73, 74, 75, 70, 41, 78, 85, 55, 90, 46, 47, 84, 112, 70, 51, 137, 53, 162, 55, 218, 111, 58, 59, 75, 121, 122, 288, 208, 125, 66, 133, 85, 69, 130, 71, 306, 145, 146, 105, 203, 143, 150, 157
Offset: 1

Views

Author

Tom Duff and N. J. A. Sloane, Oct 06 2024

Keywords

Comments

A087786 includes pairs (x,y) with x>y (which are excluded from the present sequence).

Crossrefs

Programs

  • PARI
    a(n) = sum(x=0, n-1, sum(y=x, n-1, Mod(x, n)^3 == Mod(y, n)^3)); \\ Michel Marcus, Oct 06 2024
    
  • Python
    from collections import Counter
    def A376757(n): return sum(d*(d+1)>>1 for d in Counter(pow(x,3,n) for x in range(n)).values()) # Chai Wah Wu, Oct 06 2024

A133677 Integers k such that prime(k)*(2*prime(k)-1)/3 is an integer.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 10, 13, 15, 16, 17, 20, 23, 24, 26, 28, 30, 32, 33, 35, 39, 40, 41, 43, 45, 49, 51, 52, 54, 55, 56, 57, 60, 62, 64, 66, 69, 71, 72, 76, 77, 79, 81, 83, 86, 87, 89, 91, 92, 94, 96, 97, 98, 102, 103, 104, 107, 108, 109, 113, 116, 118, 119, 120, 123, 124, 126
Offset: 1

Views

Author

Roger L. Bagula, Dec 28 2007

Keywords

Comments

Apart from the term "2", the same as A091177. - Stefan Steinerberger, Dec 29 2007
Numbers n such that the number of distinct residues r in the congruence x^3 == r (mod p) is equal to p where p = prime(n). See A046530. - Michel Lagneau, Sep 28 2016
The asymptotic density of this sequence is 1/2 (by Dirichlet's theorem). - Amiram Eldar, Feb 28 2021

Examples

			4 is not in the sequence since prime(4)*(2*prime(4) - 1)/3 = 7*(2*7 - 1)/3 = 7*13/3 = 91/3 is not an integer, but 5 is in the sequence since prime(5)*(2*prime(5) - 1)/3 = 11*(2*11 - 1)/3 = 11*21/3 = 11*7 = 77 is an integer. - _Michael B. Porter_, Sep 28 2016
		

Crossrefs

Programs

  • Maple
    for n from 1 to 126 do if((ithprime(n) mod 3) mod 2=0) then print(n) fi od; # Gary Detlefs, Dec 06 2011
  • Mathematica
    Union[Table[If[IntegerQ[Prime[n]*(2*Prime[n] - 1)/3], n, {}], {n, 1, 100}]]
    pnQ[n_]:=Module[{pn=Prime[n]},IntegerQ[(pn(2pn-1))/3]]; Select[Range[ 150], pnQ] (* Harvey P. Dale, Oct 02 2011 *)
    Sort@ Join[{2}, Select[ Range@ 126, Mod[2*Prime[#], 3] == 1 &]] (* Robert G. Wilson v, Sep 28 2016 *)
    Select[Range[126], IntegerQ[Prime[#]*(2 *Prime[#] - 1)/3] &] (* Robert Price, Apr 19 2025 *)

Formula

Integers k such that (prime(k) mod 3) mod 2 = 0. - Gary Detlefs, Dec 06 2011

A046633 Number of cubic residues mod 5^n.

Original entry on oeis.org

1, 5, 21, 101, 505, 2521, 12601, 63005, 315021, 1575101, 7875505, 39377521, 196887601, 984438005, 4922190021, 24610950101, 123054750505, 615273752521, 3076368762601, 15381843813005, 76909219065021, 384546095325101
Offset: 0

Views

Author

Keywords

Programs

  • Maple
    A046633 := proc(n)
        5^(n+2)+2*op(1+modp(n,3),[3,15,13]) ;
        %/31 ;
    end proc:
    seq(A046633(n),n=0..20) ; # R. J. Mathar, Oct 08 2017
  • Mathematica
    a[n_] := a[n] = Table[PowerMod[k, 3, 5^n], {k, 1, 5^n}] // Union // Length;
    Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 10}]
    (* or: *)
    LinearRecurrence[{5, 0, 1, -5}, {1, 5, 21, 101}, 22] (* Jean-François Alcover, Nov 23 2017 *)
  • PARI
    a(n)=(5^(n+2)+30)\31 \\ Charles R Greathouse IV, Jan 03 2013

Formula

a(n) = A046530(5^n). Conjecture: a(n)= +5*a(n-1) +a(n-3) -5*a(n-4) with g.f. ( 1-4*x^2-5*x^3 ) / ( (x-1)*(5*x-1)*(1+x+x^2) ). - R. J. Mathar, Feb 27 2011
The conjecture is correct. - Charles R Greathouse IV, Jan 03 2013
31*a(n) = 5^(n+2)+2*b(n), where b(n)=3 if n==0 (mod 3), b(n)=15 if n==1 (mod 3) and b(n)=13 if b(n)==2 (mod 3). - R. J. Mathar, Oct 08 2017

A046635 Number of cubic residues mod 7^n.

Original entry on oeis.org

1, 3, 15, 99, 689, 4817, 33713, 235987, 1651903, 11563315, 80943201, 566602401, 3966216801, 27763517603, 194344623215, 1360412362499, 9522886537489, 66660205762417, 466621440336913, 3266350082358387, 22864450576508703
Offset: 0

Views

Author

Keywords

Programs

  • Maple
    A046635 := proc(n)
        7^(n+2)+2*op(1+modp(n,3),[61,85,82]) ;
        %/171 ;
    end proc:
    seq(A046635(n),n=0..20) ; # R. J. Mathar, Oct 08 2017
  • Mathematica
    LinearRecurrence[{7, 0, 1, -7}, {1, 3, 15, 99}, 21] (* Jean-François Alcover, Nov 24 2017 *)

Formula

a(n) = A046530(7^n).
a(n)= +7*a(n-1) +a(n-3) -7*a(n-4) with g.f. ( 1-4*x-6*x^2-7*x^3 ) / ( (x-1)*(7*x-1)*(1+x+x^2) ). - R. J. Mathar, Feb 27 2011

A046636 Number of cubic residues mod 8^n.

Original entry on oeis.org

1, 5, 37, 293, 2341, 18725, 149797, 1198373, 9586981, 76695845, 613566757, 4908534053, 39268272421, 314146179365, 2513169434917, 20105355479333, 160842843834661, 1286742750677285, 10293942005418277, 82351536043346213, 658812288346769701, 5270498306774157605, 42163986454193260837
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = (4*8^n + 3)/7.
a(n) = 8*a(n-1) - 3 (with a(0)=1). - Vincenzo Librandi, Nov 18 2010
From R. J. Mathar, Feb 28 2011: (Start)
a(n) = A046530(8^n) = A046630(3*n).
G.f.: (1-4*x)/((1-8*x)*(1-x)). (End)
a(n+1) = A226308(3*n+2). - Philippe Deléham, Feb 24 2014
From Elmo R. Oliveira, Apr 03 2025: (Start)
E.g.f.: exp(x)*(4*exp(7*x) + 3)/7.
a(n) = 9*a(n-1) - 8*a(n-2).
a(n) = A047853(n+1)/2. (End)

Extensions

More terms from Elmo R. Oliveira, Apr 03 2025

A046638 Number of cubic residues mod 10^n, or number of distinct n-digit endings of cubes.

Original entry on oeis.org

1, 10, 63, 505, 5050, 47899, 466237, 4662370, 46308087, 461504593, 4615045930, 46111077091, 460913873941, 4609138739410, 46086465166623, 460840040641225, 4608400406412250, 46083388790070379, 460830811531341997, 4608308115313419970, 46083004243912737927
Offset: 0

Views

Author

Keywords

Examples

			a(1)=10 because a cube may end with any digit (10 possible combinations); a(2)=63 because a cube may end with 63 2-digit combinations (including leading zeros).
A cube may end with 63 different 2-digit combinations: 00, 01, 03, 04, 07, 08, 09, 11, 12, 13, 16, 17, 19, 21, 23, 24, 25, 27, 28, 29, 31, 32, 33, 36, 37, 39, 41, 43, 44, 47, 48, 49, 51, 52, 53, 56, 57, 59, 61, 63, 64, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 81, 83, 84, 87, 88, 89, 91, 92, 93, 96, 97, 99. Numbers ending with 14 say cannot be cubes. See also A075821, A075823. - _Zak Seidov_, Oct 18 2002
		

Crossrefs

Programs

  • PARI
    a(n)=(5^(n+2)+30)\31*((4<Charles R Greathouse IV, Jan 03 2013

Formula

a(n) = A046530(10^n) = A046630(n)*A046633(n). - R. J. Mathar, Feb 28 2011
a(n) ~ 100/217 * 10^n, so large terms start 460829493.... - Charles R Greathouse IV, Jan 03 2013
G.f.: -(10000*x^9+9000*x^8-5130*x^6-2357*x^5+259*x^3+37*x^2-1) / ((x-1)*(2*x-1)*(5*x-1)*(10*x-1)*(x^2+x+1)*(25*x^2+5*x+1)*(4*x^2+2*x+1)). - Alois P. Heinz, Jan 03 2013

Extensions

Edited by N. J. A. Sloane, Oct 19 2008

A323704 Number of cubic residues (including 0) modulo the n-th prime.

Original entry on oeis.org

2, 3, 5, 3, 11, 5, 17, 7, 23, 29, 11, 13, 41, 15, 47, 53, 59, 21, 23, 71, 25, 27, 83, 89, 33, 101, 35, 107, 37, 113, 43, 131, 137, 47, 149, 51, 53, 55, 167, 173, 179, 61, 191, 65, 197, 67, 71, 75, 227, 77, 233, 239, 81, 251, 257, 263, 269, 91, 93, 281, 95, 293
Offset: 1

Views

Author

Florian Severin, Jan 24 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[With[{p=Prime[n]},If[Mod[p,3]==1,1+(p-1)/3,p]],{n,80}] (* Harvey P. Dale, Feb 02 2025 *)
  • PARI
    a(n) = my(p=prime(n)); sum(k=0, p-1, ispower(Mod(k,p), 3)); \\ Michel Marcus, Feb 26 2019
  • Python
    from sympy import prime
    def a(n):
      p = prime(n)
      return len(set([x**3 % p for x in range(p)]))
    

Formula

If prime(n) - 1 = 3k then a(n) = k+1, otherwise a(n) = prime(n). (Cf. formula for A236959.)
a(n) = A236959(n) + 1.
a(n) = A046530(A000040(n)). - Rémy Sigrist, Jan 24 2019

A046632 Number of cubic residues mod 4^n.

Original entry on oeis.org

1, 3, 10, 37, 147, 586, 2341, 9363, 37450, 149797, 599187, 2396746, 9586981, 38347923, 153391690, 613566757, 2454267027, 9817068106, 39268272421, 157073089683, 628292358730, 2513169434917, 10052677739667, 40210710958666
Offset: 0

Views

Author

Keywords

Programs

  • Magma
    I:=[1, 3, 10, 37]; [n le 4 select I[n] else 4*Self(n-1)+Self(n-3)-4*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
  • Mathematica
    LinearRecurrence[{4,0,1,-4},{1,3,10,37},40] (* Vincenzo Librandi, Jun 22 2012 *)

Formula

G.f.: (-4x^3 - 2x^2 - x+1)/((1-4x)*(1-x^3)).
a(n) = A046530(4^n) = A046630(2n). - R. J. Mathar, Feb 27 2011
a(n) = 4*a(n-1) + a(n-3) - 4*a(n-4). - Vincenzo Librandi, Jun 22 2012

A282779 Period of cubes mod n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 3, 10, 11, 12, 13, 14, 15, 16, 17, 6, 19, 20, 21, 22, 23, 24, 25, 26, 9, 28, 29, 30, 31, 32, 33, 34, 35, 12, 37, 38, 39, 40, 41, 42, 43, 44, 15, 46, 47, 48, 49, 50, 51, 52, 53, 18, 55, 56, 57, 58, 59, 60, 61, 62, 21, 64, 65, 66, 67, 68, 69, 70, 71, 24, 73, 74, 75, 76, 77, 78, 79, 80, 27
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 21 2017

Keywords

Comments

The length of the period of A000035 (n=2), A010872 (n=3), A109718 (n=4), A070471 (n=5), A010875 (n=6), A070472 (n=7), A109753 (n=8), A167176 (n=9), A008960 (n = 10), etc. (see also comment in A000578 from R. J. Mathar).
Conjecture: let a_p(n) be the length of the period of the sequence k^p mod n where p is a prime, then a_p(n) = n/p if n == 0 (mod p^2) else a_p(n) = n.
For example: sequence k^7 mod 98 gives 1, 30, 31, 18, 19, 48, 49, 50, 79, 80, 67, 68, 97, 0, 1, 30, 31, 18, 19, 48, 49, 50, 79, 80, 67, 68, 97, 0, ... (period 14), 7 is a prime, 98 == 0 (mod 7^2) and 98/7 = 14.

Examples

			a(9) = 3 because reading 1, 8, 27, 64, 125, 216, 343, 512, ... modulo 9 gives 1, 8, 0, 1, 8, 0, 1, 8, 0, ... with period length 3.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := For[k = 1, True, k++, If[Mod[k^3, n] == 0 && Mod[(k + 1)^3 , n] == 1, Return[k]]]; Table[a[n], {n, 1, 81}]

Formula

Apparently: a(n) = 2*a(n-9) - a(n-18).
Empirical g.f.: x*(1 + 2*x + 3*x^2 + 4*x^3 + 5*x^4 + 6*x^5 + 7*x^6 + 8*x^7 + 3*x^8 + 8*x^9 + 7*x^10 + 6*x^11 + 5*x^12 + 4*x^13 + 3*x^14 + 2*x^15 + x^16) / ((1 - x)^2*(1 + x + x^2)^2*(1 + x^3 + x^6)^2). - Colin Barker, Feb 21 2017

A046634 Number of cubic residues mod 6^n.

Original entry on oeis.org

1, 6, 9, 35, 210, 1083, 6253, 37518, 222705, 1331099, 7986594, 47871651, 287102581, 1722615486, 10334532969, 62003849075, 372023094450, 2232108315723, 13392560190013, 80355361140078, 482131358602785
Offset: 0

Views

Author

Keywords

Programs

  • Mathematica
    LinearRecurrence[{6,0,36,-216,0,-251,1506,0,216,-1296},{1,6,9,35,210,1083,6253,37518,222705,1331099},30] (* Harvey P. Dale, Mar 17 2023 *)

Formula

From R. J. Mathar, Feb 27 2011: (Start)
a(n) = A046530(6^n) = A046631(n)*A046630(n).
a(n) = +6*a(n-1) +36*a(n-3) -216*a(n-4) -251*a(n-6) +1506*a(n-7) +216*a(n-9) -1296*a(n-10).
G.f.: ( 1-27*x^2-55*x^3+795*x^5+690*x^6-2808*x^8-1296*x^9 ) / ( (x-1) *(6*x-1) *(3*x-1) *(2*x-1) *(1+x+x^2) *(4*x^2+2*x+1) *(9*x^2+3*x+1) ). (End)
Previous Showing 21-30 of 31 results. Next