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 11-15 of 15 results.

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

Original entry on oeis.org

1, 2, 2, 6, 18, 70, 274, 1094, 4370, 17478, 69906, 279622, 1118482, 4473926, 17895698, 71582790, 286331154, 1145324614, 4581298450, 18325193798, 73300775186, 293203100742, 1172812402962, 4691249611846, 18764998447378
Offset: 0

Views

Author

Albert Mukovskiy, Aug 24 2023

Keywords

Comments

a(n) = A364811(2n).
For n>=2, A319281(a(n)) == 4^n + [n mod 2 == 1].
For n>=2, a(n)=k: [ A319281(k) == 4^n + [n mod 2 == 1] ].

Crossrefs

Programs

  • Mathematica
    a[n_] = Ceiling[4^n/15] + Boole[Mod[n,2]==1]; Array[a, 24]
  • PARI
    a(n) = ceil(4^n/15)+(Mod(n,2)==1);
    
  • Python
    def A365103(n): return len({pow(x,4,1<<(n<<1)) for x in range(1<<(n<<1))}) # Chai Wah Wu, Sep 18 2023

Formula

a(n) = ceiling(4^n/15) + (n mod 2).

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

Original entry on oeis.org

1, 2, 3, 2, 5, 4, 7, 3, 7, 6, 11, 4, 13, 8, 15, 5, 17, 8, 19, 4, 9, 12, 23, 6, 21, 14, 19, 8, 29, 12, 31, 9, 33, 18, 35, 8, 37, 20, 15, 6, 41, 8, 43, 12, 35, 24, 47, 10, 43, 22, 51, 8, 53, 20, 15, 12, 21, 30, 59, 8, 61, 32, 21, 17, 65, 24, 67, 10, 69, 24, 71, 12, 73, 38, 63
Offset: 1

Views

Author

Albert Mukovskiy, Aug 21 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #Set(vector(n^2, x, Mod(x-1,n^2)^n)); \\ Michel Marcus, Aug 22 2023
    
  • Python
    def A365099(n): return len({pow(x,n,n**2) for x in range(n**2)}) # Chai Wah Wu, Aug 22 2023

A365104 Number of distinct quintic residues x^5 (mod 5^n), x=0..5^n-1.

Original entry on oeis.org

1, 5, 5, 21, 101, 501, 2505, 12505, 62521, 312601, 1563001, 7815005, 39075005, 195375021, 976875101, 4884375501, 24421877505, 122109387505, 610546937521, 3052734687601, 15263673438001, 76318367190005, 381591835950005, 1907959179750021, 9539795898750101, 47698979493750501, 238494897468752505, 1192474487343762505, 5962372436718812521, 29811862183594062601
Offset: 0

Views

Author

Albert Mukovskiy, Aug 24 2023

Keywords

Comments

It appears that for a prime p>2 the number of distinct residues x^p (mod p^n) is a(n) = (p-1)*p^(n-2) + a(n-p), with a(n<1)=1, a(1)=p.

Crossrefs

Programs

  • Mathematica
    a[n_]:=CountDistinct[Table[PowerMod[x-1, 5, 5^(n-1)], {x, 1, 5^(n-1)}]]; Array[a, 13]
  • Python
    def A365104(n): return len({pow(x,5,5**n) for x in range(5**n)}) # Chai Wah Wu, Sep 17 2023

Formula

For n >= 6, a(n) = 4*5^(n-2) + a(n-5) = 5*a(n-1) + a(n-5) - 5*a(n-6). O.g.f: (-5*x^5 - 4*x^4 - 4*x^3 - 20*x^2 + 1)/(5*x^6 - x^5 - 5*x + 1). - Max Alekseyev, Feb 19 2024

Extensions

Terms a(16) onward from Max Alekseyev, Feb 19 2024

A039306 Number of distinct quadratic residues mod 9^n.

Original entry on oeis.org

1, 4, 31, 274, 2461, 22144, 199291, 1793614, 16142521, 145282684, 1307544151, 11767897354, 105911076181, 953199685624, 8578797170611, 77209174535494, 694882570819441, 6253943137374964, 56285488236374671, 506569394127372034
Offset: 0

Views

Author

Keywords

Comments

Number of distinct n-digit suffixes of base 9 squares.
From Danny Rorabaugh, Dec 15 2015: (Start)
Construct the word y_n as follows: y_0 = a; y_{n+1} is three concatenated copies of y_n, except that the middle copy is written with letters not used in y_n. For example:
y_0 = a;
y_1 = aba;
y_2 = abacdcaba;
y_3 = abacdcabaefeghgefeabacdcaba.
a(n) is the number of nonempty subwords of y_n that occur as a subword exactly once.
Let s(n, k) be the number of subwords of y_n that occur exactly 2^k times. One can show that s(n, 0) = a(n) using s(n+1, k+1) = s(n, k) + s(n, k+1), binomial(3^n+1, 2) = Sum_{k=0..n) s(n, k)*2^k, and the formulas for a(n) below.
(End)

Examples

			From _Danny Rorabaugh_, Dec 15 2015: (Start)
The squares of the numbers 0..8 are [0, 1, 4, 9, 16, 25, 36, 49, 64]. Modulo 9, these are [0, 1, 4, 0, 7, 7, 0, 4, 1]. Thus there are a(1) = 4 distinct quadratic residues module 9^1 = 9: 0, 1, 4, and 7.
There are a(2) = 31 subwords of y_2 = abacdcaba which occur in y_2 exactly once: [abac, abacd, abacdc, abacdca, abacdcab, abacdcaba, bac, bacd, bacdc, bacdca, bacdcab, bacdcaba, ac, acd, acdc, acdca, acdcab, acdcaba, cd, cdc, cdca, cdcab, cdcaba, d, dc, dca, dcab, dcaba, ca, cab, caba].
(End)
		

Crossrefs

Quadratic residues modulo k^n: A023105 (k=2), A039300 (k=3), A039301 (k=4), A039302 (k=5), A039303 (k=6), A039304 (k=7), A039305 (k=8), this sequence (k=9), A000993 (k=10).

Programs

  • Magma
    I:=[1, 4, 31]; [n le 3 select I[n] else 9*Self(n-1)+Self(n-2)-9*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Apr 22 2012
  • Mathematica
    CoefficientList[Series[(1-6*x)/((1-x)*(1-9*x)),{x,0,30}],x] (* Vincenzo Librandi, Apr 22 2012 *)

Formula

a(n) = floor((9^n+3)*3/8).
G.f.: (1-6*x)/((1-x)*(1-9*x)). - _Colin Barker, Mar 14 2012
a(n) = 9*a(n-1) +a(n-2) -9*a(n-3). - Vincenzo Librandi, Apr 22 2012
a(n) = (5+3^(2n+1))/8 = a(n-1) + 3^(2n-1). - Danny Rorabaugh, Dec 15 2015

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
Previous Showing 11-15 of 15 results.