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

A185075 The number of distinct residues modulo n of {i^i: i=1,2...}.

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 7, 6, 7, 8, 11, 8, 13, 11, 15, 10, 17, 11, 19, 13, 17, 17, 23, 15, 21, 20, 19, 18, 29, 21, 31, 18, 33, 26, 35, 18, 37, 29, 31, 24, 41, 23, 43, 28, 35, 35, 47, 27, 43, 32, 51, 33, 53, 29, 47, 33, 45, 44, 59, 36, 61, 47, 45, 34, 65, 45, 67
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    res[mod_] := Length[Union[Table[PowerMod[i,i,mod], {i, 1, mod + LCM[mod*CarmichaelLambda[mod]]}]]]; Table[res[n], {n, 100}]
  • PARI
    period(n) = lcm(n, znstar(n)[2]); \\ A174824
    a(n) = {v = []; for (i=1, period(n), v = Set(concat(v, Mod(i, n)^i));); #v;} \\ Michel Marcus, Mar 18 2016

A204693 a(n) = n^n (mod 7).

Original entry on oeis.org

1, 1, 4, 6, 4, 3, 1, 0, 1, 1, 4, 2, 1, 6, 0, 1, 2, 5, 1, 5, 1, 0, 1, 4, 1, 4, 4, 6, 0, 1, 1, 3, 2, 6, 1, 0, 1, 2, 2, 1, 2, 6, 0, 1, 4, 6, 4, 3, 1, 0, 1, 1, 4, 2, 1, 6, 0, 1, 2, 5, 1, 5, 1, 0, 1, 4, 1, 4, 4, 6, 0, 1, 1, 3, 2, 6, 1, 0, 1, 2, 2, 1, 2, 6, 0, 1, 4
Offset: 0

Views

Author

Keywords

Comments

For n>0, periodic with period 42 = A174824(7): repeat[1, 4, 6, 4, 3, 1, 0, 1, 1, 4, 2, 1, 6, 0, 1, 2, 5, 1, 5, 1, 0, 1, 4, 1, 4, 4, 6, 0, 1, 1, 3, 2, 6, 1, 0, 1, 2, 2, 1, 2, 6, 0].

Crossrefs

Programs

Formula

a(n) = a(n-42), n>42. - R. J. Mathar, Sep 25 2014
G.f.: ( -1 -4*x -2*x^37 -6*x^2 -4*x^22 -4*x^24 -4*x^25 -6*x^26 -x^28 -x^29 -3*x^30 -6*x^40 -2*x^31 -6*x^32 -x^33 -x^35 -x^17 -5*x^18 -x^19 -x^21 -x^23-x^38 -2*x^39 -2*x^36 -4*x^3 -3*x^4 -x^5 -x^7 -x^8 -4*x^9 -2*x^10 -x^11 -6*x^12 -x^14 -2*x^15 -5*x^16 ) / ( (x-1) *(1+x^6+x^5+x^4+x^3+x^2+x) *(1+x+x^2) *(1-x+x^3-x^4+x^6-x^8+x^9-x^11+x^12) *(1+x) *(1-x+x^2-x^3+x^4-x^5+x^6) *(1-x+x^2)*(1+x-x^3-x^4+x^6-x^8-x^9+x^11+x^12) ). - R. J. Mathar, Sep 25 2014

A204694 a(n) = n^n (mod 8).

Original entry on oeis.org

1, 1, 4, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0
Offset: 0

Views

Author

Keywords

Comments

Eventually periodic with period 8 = A174824(8): a(1)=1, a(2)=4 and repeat [3, 0, 5, 0, 7, 0, 1, 0].

Crossrefs

Programs

  • Mathematica
    Table[PowerMod[n,n,8], {n,0,100}]
    Join[{1, 1, 4},LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 1},{3, 0, 5, 0, 7, 0, 1, 0},84]] (* Ray Chandler, Aug 25 2015 *)
    PadRight[{1,1,4},120,{0,1,0,3,0,5,0,7}] (* Harvey P. Dale, Aug 06 2018 *)
  • PARI
    a(n)=lift(Mod(n,8)^n) \\ Charles R Greathouse IV, Jan 23 2012

Formula

G.f.: (4*x^10 + x^8 - 7*x^7 - 5*x^5 - 3*x^3 - 4*x^2 - x - 1)/(x^8 - 1). - Chai Wah Wu, Jun 04 2016
a(n) = A000312(n) mod 8. - Michel Marcus, Jun 04 2016

A204695 a(n) = n^n (mod 9).

Original entry on oeis.org

1, 1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8, 0, 1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8, 0, 1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8, 0, 1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8, 0, 1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7
Offset: 0

Views

Author

Keywords

Comments

For n>0, periodic with period 18 = A174824(9): repeat [1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8, 0].

Crossrefs

Programs

  • Mathematica
    Table[PowerMod[n,n,9], {n,0,100}]
    Join[{1},LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},{1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8, 0},86]] (* Ray Chandler, Aug 27 2015 *)
  • PARI
    a(n)=lift(Mod(n,9)^n) \\ Charles R Greathouse IV, Jan 23 2012

Formula

G.f.: (x^18 - 8*x^17 - 7*x^16 - 7*x^14 - 4*x^13 - 5*x^11 - x^10 - x^8 - 7*x^7 - 2*x^5 - 4*x^4 - 4*x^2 - x - 1)/(x^18 - 1). - Chai Wah Wu, Jun 04 2016
a(n) = A000312(n) mod 9. - Michel Marcus, Jun 04 2016

A260031 Final nonzero digit of n^n in base 12.

Original entry on oeis.org

1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 1, 1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 4, 1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 9, 1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 4, 1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 1, 1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 9, 1, 4, 3, 4, 5, 3, 7, 4, 9, 4, 11, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jul 19 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Math.NumberTheory.Moduli (powerMod)
    a260031 n = if x > 0 then x else f $ div (n ^ n) 12
              where x = powerMod n n 12
                    f z = if m == 0 then f z' else m
                          where (z', m) = divMod z 12
    -- Reinhard Zumkeller, Jul 19 2015
  • Python
    from gmpy2 import mpz, digits
    def A260031(n):
        s = digits(mpz(n)**mpz(n),12)
        t = s[-1]
        while t == '0':
            s = s[:-1]
            t = s[-1]
        return int(t,12) # Chai Wah Wu, Jul 19 2015
    

Extensions

More terms from Chai Wah Wu, Jul 19 2015

A327570 a(n) = n*phi(n)^2, phi = A000010.

Original entry on oeis.org

1, 2, 12, 16, 80, 24, 252, 128, 324, 160, 1100, 192, 1872, 504, 960, 1024, 4352, 648, 6156, 1280, 3024, 2200, 11132, 1536, 10000, 3744, 8748, 4032, 22736, 1920, 27900, 8192, 13200, 8704, 20160, 5184, 47952, 12312, 22464, 10240, 65600, 6048, 75852, 17600, 25920, 22264, 99452, 12288
Offset: 1

Views

Author

Jianing Song, Sep 17 2019

Keywords

Comments

a(n) is the order of the group consisting of all upper-triangular (or equivalently, lower-triangular) matrices in GL(2, Z_n). That is to say, a(n) = |G_n|, where G_n = {{{a, b}, {0, d}} : gcd(a, n) = gcd(d, n) = 1}. The group G_n is well-defined because the product of two upper-triangular matrices is again an upper-triangular matrix. For example,{{a, b}, {0, d}} * {{x, y}, {0, z}} = {{a*x, a*y+b*z}, {0, d*z}}.
The exponent of G_n (i.e., the least positive integer k such that x^k = e for all x in G_n) is A174824(n). (Note that {{1, 1}, {0, 1}} is an element with order n and there exists some r such that {{r, 0}, {0, r}} is an element with order psi(n), psi = A002322. It is easy to show that x^lcm(n, psi(n)) = Id = {{1, 0}, {0, 1}} for all x in G_n.)
If only upper-triangular matrices in SL(2, Z_n) are wanted, we get a group of order n*phi(n) = A002618(n) and exponent A174824(n).

Examples

			G_3 = {{{1, 0}, {0, 1}}, {{1, 1}, {0, 1}}, {{1, 2}, {0, 1}}, {{1, 0}, {0, 2}}, {{1, 1}, {0, 2}}, {{1, 2}, {0, 2}}, {{2, 0}, {0, 1}}, {{2, 1}, {0, 1}}, {{2, 2}, {0, 1}}, {{2, 0}, {0, 2}}, {{2, 1}, {0, 2}}, {{2, 2}, {0, 2}}} with order 12, so a(3) = 12.
		

Crossrefs

Programs

  • Mathematica
    Table[n * EulerPhi[n]^2, {n, 1, 100}] (* Amiram Eldar, Sep 19 2020 *)
  • PARI
    a(n) = n*eulerphi(n)^2

Formula

Multiplicative with a(p^e) = (p-1)^2*p^(3e-2).
a(n) = A000010(n)*A002618(n).
a(p) = A011379(p-1) for p prime. - Peter Luschny, Sep 17 2019
Sum_{k>=1} 1/a(k) = Product_{primes p} (1 + p^2/((p-1)^3 * (p^2 + p + 1))) = 1.7394747912949637836019917301710010334604379331855033150372654868327481539... - Vaclav Kotesovec, Sep 20 2020
Sum_{k=1..n} a(k) ~ c * n^4, where c = (1/4) * Product_{p prime} (1 - (2*p-1)/p^3) = A065464 / 4 = 0.1070623764... . - Amiram Eldar, Nov 05 2022

A309428 Irregular triangle read by rows: T(n,k) is the multiplicative order of {{A038566(n,k), 1}, {0, 1}} modulo n, n >= 1, 1 <= k <= A000010(n).

Original entry on oeis.org

1, 2, 3, 2, 4, 2, 5, 4, 4, 2, 6, 2, 7, 3, 6, 3, 6, 2, 8, 4, 8, 2, 9, 6, 9, 6, 9, 2, 10, 4, 4, 2, 11, 10, 5, 5, 5, 10, 10, 10, 5, 2, 12, 4, 6, 2, 13, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2, 14, 6, 6, 6, 6, 2, 15, 4, 6, 12, 4, 10, 12, 2, 16, 8, 16, 4, 16, 8, 16, 2, 17, 8, 16, 4, 16, 16, 16, 8
Offset: 1

Views

Author

Jianing Song, Sep 18 2019

Keywords

Comments

Let M = {{r, 1}, {0, 1}}, then M^e = {{r^e, 1 + r + r^2 + ... + r^(e-1)}, {0, 1}}. As a result, for gcd(r, n) = 1, the multiplicative order of {{r, 1}, {0, 1}} modulo n is n if r == 1 (mod n) and ord(r,n*(r-1)) otherwise, where ord(r,t) is the multiplicative order of r modulo t.

Examples

			Table starts
  1,
  2,
  3, 2,
  4, 2,
  5, 4, 4, 2,
  6, 2,
  7, 3, 6, 3, 6, 2,
  8, 4, 8, 2,
  9, 6, 9, 6, 9, 2,
  10, 4, 4, 2,
  11, 10, 5, 5, 5, 10, 10, 10, 5, 2,
  12, 4, 6, 2,
  13, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2,
  14, 6, 6, 6, 6, 2,
  15, 4, 6, 12, 4, 10, 12, 2,
  16, 8, 16, 4, 16, 8, 16, 2,
  17, 8, 16, 4, 16, 16, 16, 8, 8, 16, 16, 16, 4, 16, 8, 2,
  18, 6, 18, 6, 18, 2,
  19, 18, 18, 9, 9, 9, 3, 6, 9, 18, 3, 6, 18, 18, 18, 9, 9, 2,
  20, 4, 4, 4, 10, 4, 4, 2,
  ...
For n = 14 and k = 4, let M = {{A038566(n,k), 1}, {0, 1}} = {{9, 1}, {0, 1}}, then:
- M^2 mod 14 = {{11, 10}, {0, 1}};
- M^3 mod 14 = {{1, 7}, {0, 1}};
- M^4 mod 14 = {{9, 8}, {0, 1}};
- M^5 mod 14 = {{11, 3}, {0, 1}};
- M^6 mod 14 = {{1, 0}, {0, 1}}.
So T(14,4) = d(14,9) = 6.
		

Crossrefs

Programs

  • PARI
    row(n) = my(v=vector(n,i,i),u=vector(eulerphi(n),i,n)); v=select(i->gcd(n,i)==1,v); for(i=2, #v, u[i]=znorder(Mod(v[i], n*(v[i]-1)))); u

Formula

For gcd(n,r) = 1, 1 <= r <= n, let d(n,r) be the multiplicative order of {{r, 1}, {0, 1}}, then T(n,k) = d(n,A038566(k)).
(a) If p is an odd prime, then d(p^e,r) = p^e if r == 1 (mod p), ord(r,p^e) otherwise;
(b) d(2^e,r) = 2^(e+1-v2(r+1)), where v2(t) is the 2-adic valuation of t;
(c) For gcd(m,n) = 1, d(m*n,r) = lcm(d(m,r mod m),d(n,r mod n)).
The LCM of the n-th row is A174824(n).

A342144 Numbers m with integer solution to x^x == (x+1)^(x+1) (mod m) with x > 0.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 15, 17, 19, 21, 23, 29, 31, 33, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 57, 59, 61, 65, 67, 69, 71, 73, 77, 79, 83, 85, 87, 89, 91, 93, 95, 97, 101, 103, 105, 107, 109, 111, 113, 115, 119, 123, 127, 129, 131, 133, 137, 139, 141, 143, 145, 147, 149, 151, 155, 157, 159, 161, 163, 167
Offset: 1

Views

Author

Owen C. Keith, Mar 01 2021

Keywords

Comments

Some values of m have multiple solutions.
For example, for m = 49, 25^25 == 26^26 (mod 49) and 37^37 == 38^38 (mod 49).
All terms are odd.
First differs from A334420 at a(70) which is 167 for this sequence and 165 for A334420.
First differs from A056911 at a(21) which is 49 for this sequence and 51 for A056911.

Examples

			3 is a term since 1^1 == 2^2 (mod 3).
5 is a term since 11^11 == 12^12 (mod 5).
		

Crossrefs

Programs

  • Mathematica
    seqQ[n_] := AnyTrue[Range[LCM[n, CarmichaelLambda[n]]+1], PowerMod[#, #, n] == PowerMod[# + 1, # + 1, n] &]; Select[Range[145], seqQ]

A347671 a(n) = n^n mod 100.

Original entry on oeis.org

1, 1, 4, 27, 56, 25, 56, 43, 16, 89, 0, 11, 56, 53, 16, 75, 16, 77, 24, 79, 0, 21, 84, 67, 76, 25, 76, 3, 36, 69, 0, 31, 76, 13, 36, 75, 36, 17, 4, 59, 0, 41, 64, 7, 96, 25, 96, 63, 56, 49, 0, 51, 96, 73, 56, 75, 56, 57, 84, 39, 0, 61, 44, 47, 16, 25, 16, 23
Offset: 0

Views

Author

John Bibby, Sep 10 2021

Keywords

Crossrefs

Cf. A000312 (n^n), A056849 (mod 10), A174824.

Programs

  • Mathematica
    Table[PowerMod[n,n,100],{n,0,70}] (* Harvey P. Dale, Aug 13 2023 *)
  • Python
    def a(n): return pow(n, n, 100)
    print([a(n) for n in range(101)]) # Michael S. Branicky, Sep 26 2021

Formula

For n >= 101, a(n) = a(n-100), i.e., cyclic with period A174824(100) = 100, disregarding a(0). - Michael S. Branicky, Sep 26 2021
Previous Showing 11-19 of 19 results.