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-10 of 10 results.

A046530 Number of distinct cubic residues mod n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 3, 5, 3, 10, 11, 9, 5, 6, 15, 10, 17, 6, 7, 15, 9, 22, 23, 15, 21, 10, 7, 9, 29, 30, 11, 19, 33, 34, 15, 9, 13, 14, 15, 25, 41, 18, 15, 33, 15, 46, 47, 30, 15, 42, 51, 15, 53, 14, 55, 15, 21, 58, 59, 45, 21, 22, 9, 37, 25, 66, 23, 51, 69, 30, 71, 15, 25, 26, 63
Offset: 1

Views

Author

Keywords

Comments

In other words, number of distinct cubes mod n. - N. J. A. Sloane, Oct 05 2024
Cubic analog of A000224. - Steven Finch, Mar 01 2006
A074243 contains values of n such that a(n) = n. - Dmitri Kamenetsky, Nov 03 2012

Crossrefs

For number of k-th power residues mod n, see A000224 (k=2), A052273 (k=4), A052274 (k=5), A052275 (k=6), A085310 (k=7), A085311 (k=8), A085312 (k=9), A085313 (k=10), A085314 (k=12), A228849 (k=13).

Programs

  • Haskell
    import Data.List (nub)
    a046530 n = length $ nub $ map (`mod` n) $
                               take (fromInteger n) $ tail a000578_list
    -- Reinhard Zumkeller, Aug 01 2012
    
  • Maple
    A046530 := proc(n)
            local a,pf ;
            a := 1 ;
            if n = 1 then
                    return 1;
            end if;
            for i in  ifactors(n)[2] do
                    p := op(1,i) ;
                    e := op(2,i) ;
                    if p = 3 then
                            if e mod 3 = 0 then
                                    a := a*(3^(e+1)+10)/13 ;
                            elif e mod 3 = 1 then
                                    a := a*(3^(e+1)+30)/13 ;
                            else
                                    a := a*(3^(e+1)+12)/13 ;
                            end if;
                    elif p mod 3 = 2 then
                            if e mod 3 = 0 then
                                    a := a*(p^(e+2)+p+1)/(p^2+p+1) ;
                            elif e mod 3 = 1 then
                                    a := a*(p^(e+2)+p^2+p)/(p^2+p+1) ;
                            else
                                    a := a*(p^(e+2)+p^2+1)/(p^2+p+1) ;
                            end if;
                    else
                            if e mod 3 = 0 then
                                    a := a*(p^(e+2)+2*p^2+3*p+3)/3/(p^2+p+1) ;
                            elif e mod 3 = 1 then
                                    a := a*(p^(e+2)+3*p^2+3*p+2)/3/(p^2+p+1) ;
                            else
                                    a := a*(p^(e+2)+3*p^2+2*p+3)/3/(p^2+p+1) ;
                            end if;
                    end if;
            end do:
            a ;
    end proc:
    seq(A046530(n),n=1..40) ; # R. J. Mathar, Nov 01 2011
  • Mathematica
    Length[Union[#]]& /@ Table[Mod[k^3, n], {n, 75}, {k, n}] (* Jean-François Alcover, Aug 30 2011 *)
    Length[Union[#]]&/@Table[PowerMod[k,3,n],{n,80},{k,n}] (* Harvey P. Dale, Aug 12 2015 *)
  • PARI
    g(p,e)=if(p==3,(3^(e+1)+if(e%3==1,30,if(e%3,12,10)))/13, if(p%3==2, (p^(e+2)+if(e%3==1,p^2+p,if(e%3,p^2+1,p+1)))/(p^2+p+1),(p^(e+2)+if(e%3==1,3*p^2+3*p+2, if(e%3,3*p^2+2*p+3,2*p^2+3*p+3)))/3/(p^2+p+1)))
    a(n)=my(f=factor(n));prod(i=1,#f[,1],g(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Jan 03 2013
    
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i,1], e=f[i,2]); 1 + sum(i=0, (e-1)\3, if(p%3==1 || (p==3&&3*iAndrew Howroyd, Jul 17 2018

Formula

a(n) = n - A257301(n). - Stanislav Sykora, Apr 21 2015
a(2^n) = A046630(n). a(3^n) = A046631(n). a(5^n) = A046633(n). a(7^n) = A046635(n). - R. J. Mathar, Sep 28 2017
Multiplicative with a(p^e) = 1 + Sum_{i=0..floor((e-1)/3)} (p - 1)*p^(e-3*i-1)/k where k = 3 if (p = 3 and 3*i + 1 = e) or (p mod 3 = 1) otherwise k = 1. - Andrew Howroyd, Jul 17 2018
Sum_{k=1..n} a(k) ~ c * n^2/log(n)^(1/3), where c = (6/(13*Gamma(2/3))) * (2/3)^(-1/3) * Product_{p prime == 2 (mod 3)} (1 - (p^2+1)/((p^2+p+1)*(p^2-p+1)*(p+1))) * (1-1/p)^(-1/3) * Product_{p prime == 1 (mod 3)} (1 - (2*p^4+3*p^2+3)/(3*(p^2+p+1)*(p^2-p+1)*(p+1))) * (1-1/p)^(-1/3) = 0.48487418844474389597... (Finch and Sebah, 2006). - Amiram Eldar, Oct 18 2022

A262759 T(n,k) = Number of (n+2) X (k+2) 0..1 arrays with each row divisible by 5 and each column divisible by 7, read as a binary number with top and left being the most significant bits.

Original entry on oeis.org

2, 4, 3, 7, 9, 5, 13, 17, 25, 10, 26, 37, 49, 100, 19, 52, 107, 129, 319, 361, 37, 103, 321, 709, 1645, 1345, 1369, 74, 205, 865, 4953, 16450, 8605, 6193, 5476, 147, 410, 2449, 16705, 243220, 135595, 52993, 39751, 21609, 293, 820, 7299, 73345, 1614175
Offset: 1

Views

Author

R. H. Hardin, Sep 30 2015

Keywords

Comments

Table starts
...2......4.......7.......13........26.........52........103.........205
...3......9......17.......37.......107........321........865........2449
...5.....25......49......129.......709.......4953......16705.......73345
..10....100.....319.....1645.....16450.....243220....1614175....15350125
..19....361....1345.....8605....135595....3051121...31840777...475175089
..37...1369....6193....52993...1635877...71515801.1252506169.32264365249
..74...5476...39751...658381..37426418.3270912532
.147..21609..229841..5747701.595006235
.293..85849.1339569.51979793
.586.343396.8663743

Examples

			Some solutions for n=4, k=4
..1..0..0..0..1..1....1..1..1..1..0..0....1..0..0..0..1..1....1..1..1..1..0..0
..1..0..1..0..0..0....1..1..1..1..0..0....1..0..1..1..0..1....1..1..0..0..1..0
..1..0..0..0..1..1....1..1..1..1..0..0....1..0..1..0..0..0....1..0..1..1..0..1
..1..1..1..1..0..0....0..1..1..0..0..1....1..1..1..1..0..0....1..0..0..0..1..1
..1..1..0..1..1..1....0..1..1..0..0..1....1..1..0..0..1..0....1..0..1..1..0..1
..1..1..1..1..0..0....0..1..1..0..0..1....1..1..0..1..1..1....1..1..0..0..1..0
		

Crossrefs

Column 1 is A046630.
Row 1 is A262267.
Row 2 is A262466(n+1).

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) +a(n-3) -2*a(n-4)
k=2: a(n) = 4*a(n-1) +9*a(n-3) -36*a(n-4) -8*a(n-6) +32*a(n-7)
Empirical for row n:
n=1: a(n) = 3*a(n-1) -3*a(n-2) +3*a(n-3) -2*a(n-4)
n=2: [order 8]
n=3: [order 17]
n=4: [order 16]

A262917 T(n,k)=Number of (n+1)X(k+1) 0..1 arrays with each row divisible by 3 and each column divisible by 7, read as a binary number with top and left being the most significant bits.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 1, 6, 5, 5, 1, 11, 15, 9, 10, 1, 22, 33, 53, 27, 19, 1, 43, 99, 137, 318, 61, 37, 1, 86, 261, 853, 1411, 1207, 145, 74, 1, 171, 783, 2953, 18190, 7417, 5797, 435, 147, 1, 342, 2241, 17333, 121507, 152587, 51769, 34782, 1253, 293, 1, 683, 6723, 71721
Offset: 1

Views

Author

R. H. Hardin, Oct 04 2015

Keywords

Comments

Table starts
...1....1.......1........1...........1...........1............1...........1
...2....3.......6.......11..........22..........43...........86.........171
...3....5......15.......33..........99.........261..........783........2241
...5....9......53......137.........853........2953........17333.......71721
..10...27.....318.....1411.......18190......121507......1444558....12031011
..19...61....1207.....7417......152587.....1550557.....30497815...420921961
..37..145....5797....51769.....2045269....33948145...1282949605.32134185721
..74..435...34782...529931....42299374..1361585275.102437680622
.147.1253..189135..4701201...727767387.42115306149
.293.3593.1089701.44632313.13958567845

Examples

			Some solutions for n=4 k=4
..0..0..1..1..0....0..1..1..1..1....1..0..0..1..0....0..0..0..0..0
..1..1..0..0..0....0..1..1..0..0....1..1..0..0..0....0..0..0..0..0
..1..1..1..1..0....0..1..1..1..1....1..1..0..1..1....0..0..1..1..0
..1..1..0..0..0....0..0..0..0..0....0..1..0..0..1....0..0..1..1..0
..0..0..1..1..0....0..0..0..1..1....0..0..0..1..1....0..0..1..1..0
		

Crossrefs

Column 1 is A046630(n-1).
Column 2 is A262314(n-1).
Row 2 is A005578(n+1).
Row 3 is A262326.

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) +a(n-3) -2*a(n-4)
k=2: [order 15]
k=3: [order 15]
Empirical for row n:
n=2: a(n) = 2*a(n-1) +a(n-2) -2*a(n-3)
n=3: a(n) = 3*a(n-1) +3*a(n-2) -9*a(n-3)
n=4: [order 8]
n=5: [order 10]
n=6: [order 65]

A262319 T(n,k)=Number of (n+2)X(k+2) 0..1 arrays with each row and column divisible by 7, read as a binary number with top and left being the most significant bits.

Original entry on oeis.org

2, 3, 3, 5, 5, 5, 10, 9, 9, 10, 19, 27, 17, 27, 19, 37, 61, 133, 133, 61, 37, 74, 145, 361, 1618, 361, 145, 74, 147, 435, 1009, 6043, 6043, 1009, 435, 147, 293, 1253, 8357, 42661, 37873, 42661, 8357, 1253, 293, 586, 3593, 33993, 683218, 413893, 413893, 683218
Offset: 1

Views

Author

R. H. Hardin, Sep 17 2015

Keywords

Comments

Table starts
...2.....3......5.......10........19........37........74........147........293
...3.....5......9.......27........61.......145.......435.......1253.......3593
...5.....9.....17......133.......361......1009......8357......33993.....127121
..10....27....133.....1618......6043.....42661....683218....4276587...39384421
..19....61....361.....6043.....37873....413893...8003035..103003837.1659181705
..37...145...1009....42661....413893...7914829.281951533.7901300449
..74...435...8357...683218...8003035.281951533
.147..1253..33993..4276587.103003837
.293..3593.127121.39384421
.586.10779.795013

Examples

			Some solutions for n=4 k=4
..0..1..0..1..0..1....1..0..0..0..1..1....0..1..0..1..0..1....0..0..0..1..1..1
..1..0..1..0..1..0....1..0..0..0..1..1....1..1..1..1..1..1....0..0..0..1..1..1
..1..1..1..1..1..1....0..0..0..1..1..1....1..1..1..1..1..1....0..0..0..0..0..0
..1..0..1..0..1..0....0..0..1..1..1..0....1..1..1..1..1..1....1..1..1..0..0..0
..0..1..0..1..0..1....0..0..1..1..1..0....0..1..0..1..0..1....1..1..1..0..0..0
..0..0..0..0..0..0....1..0..1..0..1..0....0..1..0..1..0..1....1..1..1..1..1..1
		

Crossrefs

Column 1 is A046630.

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) +a(n-3) -2*a(n-4)
k=2: [order 15]
k=3: [order 43]
k=4: [order 29]

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

A319430 First differences of the tribonacci representation numbers (A003726 or A278038).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 19, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 5
Offset: 0

Views

Author

N. J. A. Sloane, Sep 30 2018

Keywords

Comments

This sequence appears to consist of runs of 1's of lengths given (essentially) by A275925, separated by single numbers > 1, which define the terms of A319431.
It would be nice to have a recurrence of some kind that produces A319431.

Crossrefs

Programs

  • Mathematica
    Differences@ Select[Range[0, 160], SequenceCount[IntegerDigits[#, 2], {1, 1, 1}] == 0 &] (* Michael De Vlieger, Dec 23 2019 *)

Formula

Conjecture: All terms are of the form ceiling(2^k/7) for some k (cf. A046630), and all numbers of the form ceiling(2^k/7) occur.
Conjecture (continued): Furthermore, new values of ceiling(2^k/7) (that is, new records) appear at n = 0, 6,12, 23, 43, 80, 148, 273, ..., which (apart from the start) are the tribonacci numbers minus 1, A000073 - 1, or A089068.
a(n) = ceiling(2^i/7) iff the Tribonacci representation of n+1 ends in i 0's. - Jeffrey Shallit, Oct 02 2018

A364811 Number of distinct residues x^4 (mod 2^n), x=0..2^n-1.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 6, 10, 18, 36, 70, 138, 274, 548, 1094, 2186, 4370, 8740, 17478, 34954, 69906, 139812, 279622, 559242, 1118482, 2236964, 4473926
Offset: 0

Views

Author

Albert Mukovskiy, Sep 14 2023

Keywords

Comments

For n>=4, A319281(a(n)) == 2^n + [(n mod 4)>0].
It appears that for n>4: a(n)=2*a(n-1)-2*[(n mod 4)==2]; a(n) = ceiling(2^n/15) - [(n mod 4)==0] + 1.

Crossrefs

Programs

  • Mathematica
    a[n_]:=CountDistinct[Table[PowerMod[x-1, 4, 2^(n-1)], {x, 1, 2^(n-1)}]]; Array[a, 24]
  • PARI
    a(n) = #Set(vector(2^(n-1), x, Mod(x-1, 2^(n-1))^4))
    
  • Python
    def A364811(n): return len({pow(x,4,1<Chai Wah Wu, Sep 17 2023

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

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)
Showing 1-10 of 10 results.