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

A074792 Least k > 1 such that k^n == 1 (mod n).

Original entry on oeis.org

2, 3, 4, 3, 6, 5, 8, 3, 4, 9, 12, 5, 14, 13, 16, 3, 18, 5, 20, 3, 4, 21, 24, 5, 6, 25, 4, 13, 30, 11, 32, 3, 34, 33, 36, 5, 38, 37, 16, 3, 42, 5, 44, 21, 16, 45, 48, 5, 8, 9, 52, 5, 54, 5, 16, 13, 7, 57, 60, 7, 62, 61, 4, 3, 66, 23, 68, 13, 70, 29, 72, 5, 74, 73, 16, 37, 78, 17, 80, 3
Offset: 1

Views

Author

Benoit Cloitre, Sep 07 2002

Keywords

Crossrefs

a(n) = {A076944(n)}^(1/n).

Programs

  • Mathematica
    Do[k = 2; While[ !IntegerQ[(k^n - 1)/n], k++ ]; Print[k], {n, 1, 80}] (* Robert G. Wilson v *)
  • PARI
    a(n)=if(n<0,0,s=2; while((s^n-1)%n>0,s++); s)
    
  • PARI
    a(n)=my(s=2); while(Mod(s,n)^n-1!=0, s++); return(s) \\ Rémy Sigrist, Apr 02 2017

Formula

If p is prime a(p)=p+1 and a(2p)=2p-1; if n is in A050384 a(n)=n+1; if n is in A067945 a(n)=3 etc. It seems that sum(k=1, n, a(k)) is asymptotic to c*n^2 with c=0.2...

A067721 Least number k such that k (k + n) is a perfect square, or 0 if impossible.

Original entry on oeis.org

1, 0, 0, 1, 0, 4, 2, 9, 1, 3, 8, 25, 4, 36, 18, 1, 2, 64, 6, 81, 16, 4, 50, 121, 1, 20, 72, 9, 36, 196, 2, 225, 4, 11, 128, 1, 12, 324, 162, 13, 5, 400, 8, 441, 100, 3, 242, 529, 1, 63, 40, 17, 144, 676, 18, 9, 7, 19, 392, 841, 4, 900, 450, 1, 8, 16, 22, 1089, 256, 23, 2, 1225
Offset: 0

Views

Author

Robert G. Wilson v, Feb 05 2002

Keywords

Comments

Impossible only for 1, 2 and 4. k equals 1 when n is in A005563. k equals 2 when n is in A054000.
Let k*(k+n)= c*c, gcd(n,k,c)=1 . Then primitive triples (n,k,c) are of the form : 1) n is prime. (n,k,c)=( p, (p*p-2*p+1)/4, (p*p-1)/4 ) 2) n=(c/t)*(c/t)- t*t, n is not a prime, t positive integer. (n,k,c)=( (c/t)*(c/t)- t*t, t*t, c ). [Ctibor O. Zizka, May 04 2009]

Examples

			a(7) = 9 because 9 (7+9) = 144 = 12^2.
		

Crossrefs

Programs

  • Mathematica
    Do[k = 1; While[ !IntegerQ[ Sqrt[ k (k + n)]], k++ ]; Print[k], {n, 5, 75} ]
  • Python
    from itertools import takewhile
    from collections import deque
    from sympy import divisors
    def A067721(n): return ((a:=next(iter(deque((d for d in takewhile(lambda d:d>2) if n else 1 # Chai Wah Wu, Aug 21 2024

A076943 Smallest k > 0 such that n*k + 1 is an n-th power.

Original entry on oeis.org

1, 4, 21, 20, 1555, 2604, 299593, 820, 29127, 348678440, 67546215517, 20345052, 61054982558011, 281241170407092, 76861433640456465, 2690420, 128583032925805678351, 211927625868, 275941052631578947368421, 174339220
Offset: 1

Views

Author

Amarnath Murthy, Oct 19 2002

Keywords

Examples

			For n = 7, 1 + 7*a(7) = 1 + 7*299593 = 2097152 = 2^21 = 8^7.
For n = 10, 1 + 10*a(10) = 1 + 10*348678440 = 3486784401 = 3^20 = 9^10. - _Marius A. Burtea_, Jun 01 2019
		

Crossrefs

Programs

  • Magma
    sol:=[];
    for u in [1..20] do
       for k in [2..100] do
          if IsIntegral((k^u-1)/u) then sol[u]:=(k^u-1)/u; break; end if;
       end for;
    end for;
    sol; // Marius A. Burtea, Jun 01 2019
  • Mathematica
    Do[k = 2; While[ !IntegerQ[(k^n - 1)/n], k++ ]; Print[(k^n - 1)/n], {n, 1, 20}] (* Robert G. Wilson v, Oct 21 2002 *)

Formula

a(n) <= ((n+1)^n - 1) / n.
a(p^k) = ((p+1)^(p^k) - 1) / p^k. - Charlie Neder, May 23 2019
a(2*p) = ((2*p-1)^(2*p) - 1) / (2*p). - Charlie Neder, May 23 2019

Extensions

Edited, corrected and extended by Robert G. Wilson v, Oct 21 2002

A256008 Self-inverse permutation of positive integers: 4k+1 is swapped with 4k+3, and 4k+2 with 4k+4.

Original entry on oeis.org

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

Views

Author

Ivan Neretin, May 06 2015

Keywords

Comments

A lexicographically minimal sequence of distinct positive integers such that a(n)*n + 1 is a square. The same condition without the requirement for a(n) to be distinct would produce A076942.

Crossrefs

Programs

  • Magma
    [n-2*(-1)^((2*n+1-(-1)^n) div 4): n in [1..100]]; // Wesley Ivan Hurt, Oct 13 2015
    
  • Magma
    I:=[3,4,1,2]; [n le 4 select I[n] else 2*Self(n-1)-2*Self(n-2)+2*Self(n-3)-Self(n-4): n in [1..80]]; // Vincenzo Librandi, Oct 14 2015
    
  • Magma
    /* By definition: */ &cat[[4*k+3,4*k+4,4*k+1,4*k+2]: k in [0..20]]; // Bruno Berselli, Oct 19 2015
    
  • Maple
    A256008:=n->n-2*(-1)^((2*n+1-(-1)^n)/4): seq(A256008(n), n=1..100); # Wesley Ivan Hurt, Oct 13 2015
  • Mathematica
    Table[BitXor[n - 1, 2] + 1, {n, 77}]
    CoefficientList[Series[(3 - 2*x - x^2 + 2*x^3)/((x - 1)^2*(x^2 + 1)), {x, 0, 100}], x] (* Wesley Ivan Hurt, Oct 13 2015 *)
    LinearRecurrence[{2, -2, 2, -1}, {3, 4, 1, 2}, 80] (* Vincenzo Librandi, Oct 14 2015 *)
  • PARI
    a(n) = bitxor(n-1,2)+1 \\ Charles R Greathouse IV, May 06 2015
    
  • PARI
    Vec(x*(3-2*x-x^2+2*x^3)/((x-1)^2*(x^2+1)) + O(x^100)) \\ Altug Alkan, Oct 13 2015
    
  • PARI
    a(n) = (-1+I)*((-I)^n+I*I^n)+n \\ Colin Barker, Oct 19 2015
    
  • Python
    def a(n): return ((n-1)^2) + 1
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Mar 21 2023

Formula

From Wesley Ivan Hurt, Oct 13 2015: (Start)
G.f.: x*(3-2*x-x^2+2*x^3)/((x-1)^2*(x^2+1)).
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4) for n>4.
a(n) = n-2*(-1)^((2*n+1-(-1)^n)/4). (End)
a(n) = (-1+i)*((-i)^n+i*i^n)+n, where i = sqrt(-1). - Colin Barker, Oct 19 2015
a(n) = 1 + A004443(n-1). - Alois P. Heinz, Jan 23 2022

A215653 a(n) = smallest positive m such that m^2 = 1+k*n with positive k.

Original entry on oeis.org

2, 3, 2, 3, 4, 5, 6, 3, 8, 9, 10, 5, 12, 13, 4, 7, 16, 17, 18, 9, 8, 21, 22, 5, 24, 25, 26, 13, 28, 11, 30, 15, 10, 33, 6, 17, 36, 37, 14, 9, 40, 13, 42, 21, 19, 45, 46, 7, 48, 49, 16, 25, 52, 53, 21, 13, 20, 57, 58, 11, 60, 61, 8, 31, 14, 23, 66, 33, 22, 29
Offset: 1

Views

Author

Zak Seidov, Aug 19 2012

Keywords

Comments

Apparently a(n) = A070667(n) for n > 2. Note the linear patterns in the graph.

Examples

			a(1) = 2, k = 3; a(2) = 3, k = 4; a(3) = 2, k = 1; a(1000) = 249, k = 62.
		

Crossrefs

Programs

  • Mathematica
    Flatten[{2,Table[Select[Range[2,1000],PowerMod[#,2,k]==1&,1],{k,2,1000}]}] (* first 1000 terms *)
  • PARI
    a(n) = {my(m = n + 1); while(!issquare(m), m += n); sqrtint(m);} \\ Amiram Eldar, Mar 16 2025

Formula

a(n) = sqrt(1+n*A076942(n)).
a(n) = sqrt(A061369(n)). - Amiram Eldar, Mar 16 2025

A076944 Least number such that n*k+1 is an n-th power.

Original entry on oeis.org

2, 9, 64, 81, 7776, 15625, 2097152, 6561, 262144, 3486784401, 743008370688, 244140625, 793714773254144, 3937376385699289, 1152921504606846976, 43046721, 2185911559738696531968, 3814697265625
Offset: 1

Views

Author

Amarnath Murthy, Oct 19 2002

Keywords

Comments

a(n) <= {(n+1)^n - 1}/n.

Crossrefs

Programs

  • Mathematica
    Do[k = 2; While[ !IntegerQ[(k^n - 1)/n], k++ ]; Print[k^n], {n, 1, 19}]

Formula

a(n) = n*A076943(n) + 1.

Extensions

Edited, corrected and extended by Robert G. Wilson v, Oct 21 2002

A215696 a(n)=smallest positive k>n+2 such that k*n+1 is a square.

Original entry on oeis.org

8, 12, 8, 12, 16, 20, 24, 15, 32, 36, 40, 24, 48, 52, 24, 33, 64, 68, 72, 42, 40, 84, 88, 35, 96, 100, 104, 60, 112, 56, 120, 69, 56, 132, 48, 78, 144, 148, 72, 60, 160, 72, 168, 96, 91, 180, 184, 63, 192, 196, 88, 114, 208, 212, 105, 85, 104, 228, 232, 84
Offset: 1

Views

Author

Zak Seidov, Aug 21 2012

Keywords

Comments

For any n and k=n+2, 1+k*n=(n+1)^2, so here we consider the case k>n+2. Cases kA076942, A215653.

Crossrefs

Programs

  • PARI
    for(n=1,100,k=n+3;while(!issquare(1+k*n),k++);print1(k","))
Showing 1-7 of 7 results.