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

A268336 a(n) = A174824(n)/n, where A174824(n) = lcm(A002322(n), n) and A002322(n) is the Carmichael lambda function (also known as the reduced totient function or the universal exponent of n).

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 1, 2, 2, 10, 1, 12, 3, 4, 1, 16, 1, 18, 1, 2, 5, 22, 1, 4, 6, 2, 3, 28, 2, 30, 1, 10, 8, 12, 1, 36, 9, 4, 1, 40, 1, 42, 5, 4, 11, 46, 1, 6, 2, 16, 3, 52, 1, 4, 3, 6, 14, 58, 1, 60, 15, 2, 1, 12, 5, 66, 4, 22, 6, 70, 1, 72, 18, 4, 9, 30, 2, 78, 1, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 01 2016

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [Lcm(n, CarmichaelLambda(n))/n: n in [2..100]]: // Feb 03 2016
    
  • Mathematica
    Table[LCM[n, CarmichaelLambda@ n]/n, {n, 100}] (* Michael De Vlieger, Feb 03 2016, after T. D. Noe at A174824 *)
  • PARI
    a(n)=my(ps); ps=factor(n)[, 1]~; m = n; for(k=1, #ps, m=lcm(m, ps[k]-1)); m/n \\ Michel Marcus, Feb 21 2016
    
  • PARI
    apply( {A268336(n)=lcm(lcm([p-1|p<-factor(n)[,1]]),n)/n}, [1..99]) \\ [...] = znstar(n)[2], but 3x faster. - M. F. Hasler, Nov 13 2019

Formula

a(n) = A174824(n)/n.
a(A124240(n)) = 1. - Michel Marcus, Feb 21 2016

Extensions

More terms from Vincenzo Librandi, Feb 03 2016

A320602 Irregular table read by rows: T(n,k) = (k+s)^(k+s) mod n, s = lcm(n, A002322(n)) = A174824(n), 0 <= k <= s - 1.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 2, 0, 1, 0, 3, 0, 1, 4, 2, 1, 0, 1, 3, 1, 4, 0, 1, 1, 3, 1, 0, 1, 2, 4, 4, 0, 1, 4, 3, 4, 5, 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, 0, 3, 0, 5, 0, 7
Offset: 1

Views

Author

Jianing Song, Oct 17 2018

Keywords

Comments

A174824(n) is the period of the sequence {k^k mod n}.
If n > 1 is factored as Product_{i=1..m} (p_i)^(e_i), then {k^k mod n : k > e} is purely periodic, e = max_{i=1..m} (p_i)*floor((e_i - 1)/(p_i)). For n > 1, {k^k mod n : k > 0} is purely periodic iff e_i <= p_i, 1 <= i <= m.

Examples

			Table starts
n = 1: 0,
n = 2: 0, 1,
n = 3: 0, 1, 1, 0, 1, 2,
n = 4: 0, 1, 0, 3,
n = 5: 0, 1, 4, 2, 1, 0, 1, 3, 1, 4, 0, 1, 1, 3, 1, 0, 1, 2, 4, 4,
n = 6: 0, 1, 4, 3, 4, 5,
n = 7: 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,
n = 8: 0, 1, 0, 3, 0, 5, 0, 7,
n = 9: 0, 1, 4, 0, 4, 2, 0, 7, 1, 0, 1, 5, 0, 4, 7, 0, 7, 8,
n = 10: 0, 1, 4, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 4, 9,
		

Crossrefs

Programs

  • PARI
    T(n,k) = my(s=lcm(n, lcm(znstar(n)[2]))); lift(Mod(k+s, n)^(k+s))
    tabf(nn) = for(n=1, nn, for(k=0, lcm(n, lcm(znstar(n)[2]))-1, print1(T(n,k)", ")); print)

Formula

T(n,k) = k^k mod n iff: let p be any prime factor of k, then n is not divisible by p^(k+1).

A000312 a(n) = n^n; number of labeled mappings from n points to themselves (endofunctions).

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420489, 10000000000, 285311670611, 8916100448256, 302875106592253, 11112006825558016, 437893890380859375, 18446744073709551616, 827240261886336764177, 39346408075296537575424, 1978419655660313589123979
Offset: 0

Views

Author

Keywords

Comments

Also number of labeled pointed rooted trees (or vertebrates) on n nodes.
For n >= 1 a(n) is also the number of n X n (0,1) matrices in which each row contains exactly one entry equal to 1. - Avi Peretz (njk(AT)netvision.net.il), Apr 21 2001
Also the number of labeled rooted trees on (n+1) nodes such that the root is lower than its children. Also the number of alternating labeled rooted ordered trees on (n+1) nodes such that the root is lower than its children. - Cedric Chauve (chauve(AT)lacim.uqam.ca), Mar 27 2002
With p(n) = the number of integer partitions of n, p(i) = the number of parts of the i-th partition of n, d(i) = the number of different parts of the i-th partition of n, p(j, i) = the j-th part of the i-th partition of n, m(i, j) = multiplicity of the j-th part of the i-th partition of n, one has: a(n) = Sum_{i=1..p(n)} (n!/(Product_{j=1..p(i)} p(i, j)!)) * ((n!/(n - p(i)))!/(Product_{j=1..d(i)} m(i, j)!)). - Thomas Wieder, May 18 2005
All rational solutions to the equation x^y = y^x, with x < y, are given by x = A000169(n+1)/A000312(n), y = A000312(n+1)/A007778(n), where n = 1, 2, 3, ... . - Nick Hobson, Nov 30 2006
a(n) is the total number of leaves in all (n+1)^(n-1) trees on {0,1,2,...,n} rooted at 0. For example, with edges directed away from the root, the trees on {0,1,2} are {0->1,0->2},{0->1->2},{0->2->1} and contain a total of a(2)=4 leaves. - David Callan, Feb 01 2007
Limit_{n->infinity} A000169(n+1)/a(n) = exp(1). Convergence is slow, e.g., it takes n > 74 to get one decimal place correct and n > 163 to get two of them. - Alonso del Arte, Jun 20 2011
Also smallest k such that binomial(k, n) is divisible by n^(n-1), n > 0. - Michel Lagneau, Jul 29 2013
For n >= 2 a(n) is represented in base n as "one followed by n zeros". - R. J. Cano, Aug 22 2014
Number of length-n words over the alphabet of n letters. - Joerg Arndt, May 15 2015
Number of prime parking functions of length n+1. - Rui Duarte, Jul 27 2015
The probability density functions p(x, m=q, n=q, mu=1) = A000312(q)*E(x, q, q) and p(x, m=q, n=1, mu=q) = (A000312(q)/A000142(q-1))*x^(q-1)*E(x, q, 1), with q >= 1, lead to this sequence, see A163931, A274181 and A008276. - Johannes W. Meijer, Jun 17 2016
Satisfies Benford's law [Miller, 2015]. - N. J. A. Sloane, Feb 12 2017
A signed version of this sequence apart from the first term (1, -4, -27, 256, 3125, -46656, ...), has the following property: for every prime p == 1 (mod 2n), (-1)^(n(n-1)/2)*n^n = A057077(n)*a(n) is always a 2n-th power residue modulo p. - Jianing Song, Sep 05 2018
From Juhani Heino, May 07 2019: (Start)
n^n is both Sum_{i=0..n} binomial(n,i)*(n-1)^(n-i)
and Sum_{i=0..n} binomial(n,i)*(n-1)^(n-i)*i.
The former is the familiar binomial distribution of a throw of n n-sided dice, according to how many times a required side appears, 0 to n. The latter is the same but each term is multiplied by its amount. This means that if the bank pays the player 1 token for each die that has the chosen side, it is always a fair game if the player pays 1 token to enter - neither bank nor player wins on average.
Examples:
2-sided dice (2 coins): 4 = 1 + 2 + 1 = 1*0 + 2*1 + 1*2 (0 omitted from now on);
3-sided dice (3 long triangular prisms): 27 = 8 + 12 + 6 + 1 = 12*1 + 6*2 + 1*3;
4-sided dice (4 long square prisms or 4 tetrahedrons): 256 = 81 + 108 + 54 + 12 + 1 = 108*1 + 54*2 + 12*3 + 1*4;
5-sided dice (5 long pentagonal prisms): 3125 = 1024 + 1280 + 640 + 160 + 20 + 1 = 1280*1 + 640*2 + 160*3 + 20*4 + 1*5;
6-sided dice (6 cubes): 46656 = 15625 + 18750 + 9375 + 2500 + 375 + 30 + 1 = 18750*1 + 9375*2 + 2500*3 + 375*4 + 30*5 + 1*6.
(End)
For each n >= 1 there is a graph on a(n) vertices whose largest independent set has size n and whose independent set sequence is constant (specifically, for each k=1,2,...,n, the graph has n^n independent sets of size k). There is no graph of smaller order with this property (Ball et al. 2019). - David Galvin, Jun 13 2019
For n >= 2 and 1 <= k <= n, a(n)*(n + 1)/4 + a(n)*(k - 1)*(n + 1 - k)/2*n is equal to the sum over all words w = w(1)...w(n) of length n over the alphabet {1, 2, ..., n} of the following quantity: Sum_{i=1..w(k)} w(i). Inspired by Problem 12432 in the AMM (see links). - Sela Fried, Dec 10 2023
Also, dimension of the unique cohomology group of the smallest interval containing the poset of partitions decorated by Perm, i.e. the poset of pointed partitions. - Bérénice Delcroix-Oger, Jun 25 2025

Examples

			G.f. = 1 + x + 4*x^2 + 27*x^3 + 256*x^4 + 3125*x^5 + 46656*x^6 + 823543*x^7 + ...
		

References

  • F. Bergeron, G. Labelle and P. Leroux, Combinatorial Species and Tree-Like Structures, Cambridge, 1998, pp. 62, 63, 87.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 173, #39.
  • A. P. Prudnikov, Yu. A. Brychkov and O.I. Marichev, "Integrals and Series", Volume 1: "Elementary Functions", Chapter 4: "Finite Sums", New York, Gordon and Breach Science Publishers, 1986-1992, Eq. (4.2.2.37)
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First column of triangle A055858. Row sums of A066324.
Cf. A001923 (partial sums), A002109 (partial products), A007781 (first differences), A066588 (sum of digits).
Cf. A056665, A081721, A130293, A168658, A275549-A275558 (various classes of endofunctions).

Programs

  • Haskell
    a000312 n = n ^ n
    a000312_list = zipWith (^) [0..] [0..]  -- Reinhard Zumkeller, Jul 07 2012
    
  • Maple
    A000312 := n->n^n: seq(A000312(n), n=0..17);
  • Mathematica
    Array[ #^# &, 16] (* Vladimir Joseph Stephan Orlovsky, May 01 2008 *)
    Table[Sum[StirlingS2[n, i] i! Binomial[n, i], {i, 0, n}], {n, 0, 20}] (* Geoffrey Critzer, Mar 17 2009 *)
    a[ n_] := If[ n < 1, Boole[n == 0], n^n]; (* Michael Somos, May 24 2014 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ 1 / (1 + LambertW[-x]), {x, 0, n}]]; (* Michael Somos, May 24 2014 *)
    a[ n_] := If[n < 0, 0, n! SeriesCoefficient[ Nest[ 1 / (1 - x / (1 - Integrate[#, x])) &, 1 + O[x], n], {x, 0, n}]]; (* Michael Somos, May 24 2014 *)
    a[ n_] := If[ n < 0, 0, With[{m = n + 1}, m! SeriesCoefficient[ InverseSeries[ Series[ (x - 1) Log[1 - x], {x, 0, m}]], m]]]; (* Michael Somos, May 24 2014 *)
  • Maxima
    A000312[n]:=if n=0 then 1 else n^n$
    makelist(A000312[n],n,0,30); /* Martin Ettl, Oct 29 2012 */
    
  • PARI
    {a(n) = n^n};
    
  • PARI
    is(n)=my(b,k=ispower(n,,&b));if(k,for(e=1,valuation(k,b), if(k/b^e == e, return(1)))); n==1 \\ Charles R Greathouse IV, Jan 14 2013
    
  • PARI
    {a(n) = my(A = 1 + O(x)); if( n<0, 0, for(k=1, n, A = 1 / (1 - x / (1 - intformal( A)))); n! * polcoeff( A, n))}; /* Michael Somos, May 24 2014 */
    
  • Python
    def A000312(n): return n**n # Chai Wah Wu, Nov 07 2022

Formula

a(n-1) = -Sum_{i=1..n} (-1)^i*i*n^(n-1-i)*binomial(n, i). - Yong Kong (ykong(AT)curagen.com), Dec 28 2000
E.g.f.: 1/(1 + W(-x)), W(x) = principal branch of Lambert's function.
a(n) = Sum_{k>=0} binomial(n, k)*Stirling2(n, k)*k! = Sum_{k>=0} A008279(n,k)*A048993(n,k) = Sum_{k>=0} A019538(n,k)*A007318(n,k). - Philippe Deléham, Dec 14 2003
E.g.f.: 1/(1 - T), where T = T(x) is Euler's tree function (see A000169).
a(n) = A000169(n+1)*A128433(n+1,1)/A128434(n+1,1). - Reinhard Zumkeller, Mar 03 2007
Comment on power series with denominators a(n): Let f(x) = 1 + Sum_{n>=1} x^n/n^n. Then as x -> infinity, f(x) ~ exp(x/e)*sqrt(2*Pi*x/e). - Philippe Flajolet, Sep 11 2008
E.g.f.: 1 - exp(W(-x)) with an offset of 1 where W(x) = principal branch of Lambert's function. - Vladimir Kruchinin, Sep 15 2010
a(n) = (n-1)*a(n-1) + Sum_{i=1..n} binomial(n, i)*a(i-1)*a(n-i). - Vladimir Shevelev, Sep 30 2010
With an offset of 1, the e.g.f. is the compositional inverse ((x - 1)*log(1 - x))^(-1) = x + x^2/2! + 4*x^3/3! + 27*x^4/4! + .... - Peter Bala, Dec 09 2011
a(n) = denominator((1 + 1/n)^n) for n > 0. - Jean-François Alcover, Jan 14 2013
a(n) = A089072(n,n) for n > 0. - Reinhard Zumkeller, Mar 18 2013
a(n) = (n-1)^(n-1)*(2*n) + Sum_{i=1..n-2} binomial(n, i)*(i^i*(n-i-1)^(n-i-1)), n > 1, a(0) = 1, a(1) = 1. - Vladimir Kruchinin, Nov 28 2014
log(a(n)) = lim_{k->infinity} k*(n^(1+1/k) - n). - Richard R. Forberg, Feb 04 2015
From Ilya Gutkovskiy, Jun 18 2016: (Start)
Sum_{n>=1} 1/a(n) = 1.291285997... = A073009.
Sum_{n>=1} 1/a(n)^2 = 1.063887103... = A086648.
Sum_{n>=1} n!/a(n) = 1.879853862... = A094082. (End)
A000169(n+1)/a(n) -> e, as n -> oo. - Daniel Suteu, Jul 23 2016
a(n) = n!*Product_{k=1..n} binomial(n, k)/Product_{k=1..n-1} binomial(n-1, k) = n!*A001142(n)/A001142(n-1). - Tony Foster III, Sep 05 2018
a(n-1) = abs(p_n(2-n)), for n > 2, the single local extremum of the n-th row polynomial of A055137 with Bagula's sign convention. - Tom Copeland, Nov 15 2019
Sum_{n>=1} (-1)^(n+1)/a(n) = A083648. - Amiram Eldar, Jun 25 2021
Limit_{n->oo} (a(n+1)/a(n) - a(n)/a(n-1)) = e (see Brothers/Knox link). - Harlan J. Brothers, Oct 24 2021
Conjecture: a(n) = Sum_{i=0..n} A048994(n, i) * A048993(n+i, n) for n >= 0; proved by Mike Earnest, see link at A354797. - Werner Schulte, Jun 19 2022

A009262 a(n) = lcm(n, phi(n)).

Original entry on oeis.org

1, 2, 6, 4, 20, 6, 42, 8, 18, 20, 110, 12, 156, 42, 120, 16, 272, 18, 342, 40, 84, 110, 506, 24, 100, 156, 54, 84, 812, 120, 930, 32, 660, 272, 840, 36, 1332, 342, 312, 80, 1640, 84, 1806, 220, 360, 506, 2162, 48, 294, 100, 1632, 312, 2756, 54, 440, 168, 684, 812, 3422
Offset: 1

Views

Author

Keywords

Comments

This is a divisibility sequence: if n divides m, a(n) divides a(m). - Franklin T. Adams-Watters, Mar 30 2010
a(n) = n iff n is in A007694.
a(n) is a divisor of A299822(n). It is a proper divisor iff n is in A069209. - Max Alekseyev, Oct 11 2024

Crossrefs

Programs

Formula

a(n) = A000010(n) * A109395(n) = n * A076512(n) = A299822(n) / gcd(A007947(n),phi(A007947(n))). - Max Alekseyev, Oct 11 2024

A267817 Numbers m that are divisible by A268336(m).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 30, 32, 36, 40, 42, 48, 50, 54, 60, 64, 68, 72, 78, 80, 84, 90, 96, 100, 108, 110, 114, 120, 126, 128, 136, 144, 150, 156, 160, 162, 168, 180, 192, 200, 204, 210, 216, 220, 222, 228, 234, 240
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 13 2016

Keywords

Comments

Squarefree terms: 1, 2, 6, 10, 30, 42, 78, 110, 114, 210, 222, ...

Examples

			10 is in this sequence because 10/A268336(10) = 10/2 = 5.
		

Crossrefs

Programs

  • PARI
    is(n)=my(f=factor(n)[, 1],m=n); for(k=1, #f, m=lcm(m, f[k]-1)); m/=n; m && n%m==0 \\ Charles R Greathouse IV, Feb 22 2016

Extensions

a(16) inserted by Charles R Greathouse IV, Feb 22 2016

A204688 a(n) = n^n (mod 3).

Original entry on oeis.org

1, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1
Offset: 0

Views

Author

Keywords

Comments

For n>0, a(n) is periodic with period 6: repeat [1, 1, 0, 1, 2, 0].
Decimal expansion of 1110119/9999990. - David A. Corneth, Jun 28 2016

Crossrefs

Programs

Formula

G.f.: (1+x+x^2+x^4+2*x^5-x^6) / (1-x^6). - Bruno Berselli, Jan 18 2012
From Wesley Ivan Hurt, Jun 28 2016: (Start)
a(n) = a(n-6) for n>6.
a(n) = sin(n*Pi/3) * (10*sin(n*Pi/3) + 2*sin(2*n*Pi/3) - sqrt(3) - 2*sqrt(3)*cos(n*Pi/3))/6 for n>0. (End)
a(n) = A010872(A000312(n)). - Michel Marcus, Jun 28 2016

A204671 a(n) = n^n (mod 6).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

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

Crossrefs

Programs

  • Magma
    [1] cat &cat [[1, 4, 3, 4, 5, 0]^^20]; // Wesley Ivan Hurt, Jun 23 2016
    
  • Maple
    A204671:=n->[1, 4, 3, 4, 5, 0][(n mod 6)+1]: 1, seq(A204671(n), n=0..100); # Wesley Ivan Hurt, Jun 23 2016
  • Mathematica
    Table[PowerMod[n,n,6], {n,0,140}]
    Join[{1},LinearRecurrence[{0, 0, 0, 0, 0, 1},{1, 4, 3, 4, 5, 0},86]] (* Ray Chandler, Aug 26 2015 *)
  • PARI
    a(n)=lift(Mod(n, 6)^n) \\ Andrew Howroyd, Feb 25 2018

Formula

G.f.: (x^6-5*x^5-4*x^4-3*x^3-4*x^2-x-1)/((x-1)*(x+1)*(x^2-x+1)*(x^2+x+1)). [Colin Barker, Jul 20 2012]
From Wesley Ivan Hurt, Jun 23 2016: (Start)
a(n) = a(n-6) for n>5.
a(0) = 1, a(n) = (17 - cos(n*Pi) - 8*cos(n*Pi/3) - 8*cos(2*n*Pi/3) - 4*sqrt(3)*sin(n*Pi/3) - 4*sqrt(3)*sin(2*n*Pi/3))/6 for n>0. (End)
a(n) = A010875(A000312(n)). - Michel Marcus, Jun 27 2016

A204689 a(n) = n^n (mod 4).

Original entry on oeis.org

1, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0
Offset: 0

Views

Author

Keywords

Comments

Apart from a(0), the same as A109718. [Joerg Arndt, Sep 17 2013]
Periodic for n>0 with period 4 = A174824(4): repeat [1, 0, 3, 0].

Crossrefs

Programs

Formula

From Bruno Berselli, Jan 18 2012: (Start)
G.f.: (1+x+3x^3-x^4)/(1-x^4).
a(n) = (1-(-1)^n)*(2+i^(n+1))/2 with i=sqrt(-1), a(0)=1.
a(n) = A109718(n) for n>0. (End)
a(2k) = A000007(k), a(2k+1) = A010684(k). - Wesley Ivan Hurt, Jun 15 2016

A204690 n^n (mod 5).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

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

Crossrefs

Programs

  • Mathematica
    Table[PowerMod[n,n,5], {n,0,140}]
    Join[{1},LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},{1, 4, 2, 1, 0, 1, 3, 1, 4, 0, 1, 1, 3, 1, 0, 1, 2, 4, 4, 0},86]] (* Ray Chandler, Aug 26 2015 *)

A338445 Numbers m with integer solution to x^x == (x+1)^(x+1) (mod m) with 1<=x

Original entry on oeis.org

3, 11, 13, 19, 23, 29, 31, 43, 49, 53, 57, 59, 61, 67, 71, 73, 77, 79, 83, 85, 89, 91, 93, 97, 101, 103, 109, 113, 127, 129, 131, 133, 141, 143, 147, 149, 151, 157, 161, 163, 167, 169, 173, 177, 179, 183, 187, 197, 199, 201, 203, 205, 211, 217, 229, 235, 237, 239
Offset: 1

Views

Author

Owen C. Keith, Oct 28 2020

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. - Robert Israel, Nov 25 2020

Examples

			3 is a term because 1^1 == 2^2 (mod 3).
11 is a term because 8^8 == 9^9 (mod 11).
13 is a term because 8^8 == 9^9 (mod 13).
		

Crossrefs

Similar sequences: A174824, A239061, A239062, A239063.

Programs

  • Maple
    filter:= proc(n) local x,y,z;
      y:= 1;
      for x from 2 to n-1 do
        z:= x &^ x mod n;
        if z = y then return true fi;
        y:= z
      od;
      false
    end proc:
    select(filter, [$2..1000]); # Robert Israel, Nov 25 2020
  • Mathematica
    seqQ[n_] := AnyTrue[Range[n - 1], PowerMod[#, #, n] == PowerMod[# + 1, # + 1, n] &]; Select[Range[240], seqQ] (* Amiram Eldar, Oct 28 2020 *)
  • PARI
    isok(m)=sum(i=1, m-1, Mod(i,m)^i == Mod((i+1),m)^(i+1)) \\ Andrew Howroyd, Oct 28 2020
Showing 1-10 of 19 results. Next