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.

A140331 Smallest k such that 3^(3^n) - k is prime.

Original entry on oeis.org

1, 4, 2, 26, 10, 466, 506, 128, 13342, 5974, 8410, 6470
Offset: 0

Views

Author

Jonathan Vos Post, May 26 2008

Keywords

Comments

This is to 3 as A058220 is to 2.

Examples

			a(4) = 10 because 3^(3^4) - 10 = 443426488243037769948249630619149892793 is prime.
		

Crossrefs

Cf. A055777 (3^(3^n)), A058220.

Programs

  • PARI
    a(n) = x = 3^(3^n); x - precprime(x); \\ Michel Marcus, Jan 28 2015

Formula

a(n) = A064722(A055777(n)). - Michel Marcus, Jan 28 2015

Extensions

a(5)-a(8) from Cino Hilliard, Jun 02 2008
a(9)-a(10) from Donovan Johnson, Sep 13 2008
a(0) prepended and a(11) from Michael S. Branicky, Aug 23 2024

A175090 Composites c with result 0 under iterations of {r mod (max prime p <= r)} starting at r = c.

Original entry on oeis.org

9, 10, 15, 16, 21, 22, 25, 26, 28, 33, 34, 36, 39, 40, 45, 46, 49, 50, 52, 55, 56, 58, 63, 64, 66, 69, 70, 75, 76, 78, 81, 82, 85, 86, 88, 91, 92, 94, 96, 99, 100, 105, 106, 111, 112, 115, 116, 118, 120, 122, 123, 124, 126, 129, 130, 133, 134, 136, 141, 142
Offset: 1

Views

Author

Jaroslav Krizek, Jan 28 2010

Keywords

Comments

Intersection of A002808 and A175089.
Composites c such that A121559(c) = 0. - Michel Marcus, Aug 22 2014

Examples

			Iteration procedure for a(3) = 15: 15 mod 13 = 2, 2 mod 2 = 0.
		

Crossrefs

Cf. A007917 and A064722 (both for the iterations).

Programs

  • Maple
    g:= proc(x) if isprime(x) then 0 else x mod prevprime(x) fi end proc:
    f:= proc(x) local y; y:= x; while y > 1 do y:= g(y) od; y = 0 end proc:
    select(not(isprime) and f, [$4..200]); # Robert Israel, Feb 09 2015
  • Mathematica
    Composites := Select[Range[2, 200], ! PrimeQ[#] &]; Select[Composites, PrimeQ[# - NextPrime[#, -1]] &] (* Carlos Eduardo Olivieri, Feb 09 2015 *)

Extensions

Missing term 55 inserted, more terms added, Michel Marcus, Aug 22 2014

A378366 Difference between n and the greatest non prime power <= n (allowing 1).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Crossrefs

Sequences obtained by subtracting each term from n are placed in parentheses below.
For nonprime we almost have A010051 (A179278).
For prime we have A064722 (A007917).
For perfect power we have A069584 (A081676).
For squarefree we have (A070321).
For prime power we have A378457 = A276781-1 (A031218).
For nonsquarefree we have (A378033).
For non perfect power we almost have A075802 (A378363).
Subtracting from n gives (A378367).
The opposite is A378371, adding n A378372.
A000015 gives the least prime power >= n (cf. A378370 = A377282 - 1).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A151800 gives the least prime > n, weak version A007918.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[n-NestWhile[#-1&,n,PrimePowerQ[#]&],{n,100}]

Formula

a(n) = n - A378367(n).

A175078 Number of iterations of {r mod (max prime p < r)} needed to reach 1 or 2 starting at r = n.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

a(123) = 3 (first occurrence of value 3), a(1357324) = 4 (first occurrence of value 4). I offer a prize of 100 liters of Pilsner Urquell to the discoverer of value of first occurrence of value 5. See A175071 (natural numbers m with result 1) and A175072 (natural numbers m with result 2). See A175077 = results 1 or 2 under iterations of {r mod (max prime p < r)} starting at r = n.
Essentially the same as A121561. [R. J. Mathar, Jan 28 2010]
The function r mod (max prime p < r), which appears in the definition, equals r - (max prime p < r) = A049711(r), because p < r < 2*p by Bertrand's postulate, where p is the largest prime less than r. - Pontus von Brömssen, Jul 31 2022

Examples

			a(123) = 3; iteration procedure for n = 123: 123 mod 113 = 10, 10 mod 7 = 3, 3 mod 2 = 1.
		

Crossrefs

Programs

  • Mathematica
    Array[-1 + Length@ NestWhileList[Mod[#, NextPrime[#, -1]] &, #, Not[1 <= # <= 2] &, 1, 120] &, 105] (* Michael De Vlieger, Oct 30 2017 *)
  • PARI
    A175078(n) = if(n<=2,0,1+A175078(n%precprime(n-1))); \\ Antti Karttunen, Oct 30 2017

Formula

a(n) = A121561(n-1) for n >= 2, because the functions that are iterated (A049711 here, A064722 in A121561) satisfies A049711(r) = A064722(r-1) + 1. - Pontus von Brömssen, Jul 31 2022

Extensions

Name shortened by Antti Karttunen, Oct 30 2017

A364452 Smallest k such that 4^(4^n) - k is prime.

Original entry on oeis.org

1, 5, 5, 159, 569, 1557, 2439, 25353, 24317, 164073
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Jul 25 2023

Keywords

Comments

This is to 4 as A058220 is to 2 and A140331 is to 3.
a(8) > 22174.

Examples

			a(2) = 5 because 4^(4^2) - 5 = 4294967291 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=4^(4^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[4^(4^n)-k],Break[]];k++];k],k],{n,1,7}]
    y[n_] := Module[{x = 4^(4^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 4^(4^n)); x - precprime(x);

Formula

a(n) = A064722(A137840(n)).
a(n) = A058220(2*n+1). - Michael S. Branicky, Aug 23 2024

Extensions

a(8) using search and a(9) using A058220 from Michael S. Branicky, Aug 23 2024
a(0) = 1 prepended by Michael S. Branicky, Apr 20 2025

A364453 Smallest k such that 5^(5^n) - k is prime.

Original entry on oeis.org

2, 4, 64, 124, 228, 10978, 73738, 66346
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Jul 25 2023

Keywords

Comments

This is to 5 as A058220 is to 2 and A140331 is to 3.
a(7) > 5487.

Examples

			a(2) = 64 because 5^(5^2) - 64 = 298023223876953061 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=5^(5^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[5^(5^n)-k],Break[]];k++];k],k],{n,1,7}]
    y[n_] := Module[{x = 5^(5^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 5^(5^n)); x - precprime(x);

Formula

a(n) = A064722(A137841(n)).

Extensions

a(0) prepended and a(7) from Michael S. Branicky, Aug 24 2024

A175089 Numbers m with result 0 under iterations of {r mod (max prime p <= r)} starting at r = m.

Original entry on oeis.org

2, 3, 5, 7, 9, 10, 11, 13, 15, 16, 17, 19, 21, 22, 23, 25, 26, 28, 29, 31, 33, 34, 36, 37, 39, 40, 41, 43, 45, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 63, 64, 66, 67, 69, 70, 71, 73, 75, 76, 78, 79, 81, 82, 83, 85, 86, 88, 89, 91, 92, 94, 96, 97, 99, 100
Offset: 1

Views

Author

Jaroslav Krizek, Jan 28 2010

Keywords

Comments

Complement of A175088.
Union of A000040 (primes) and A175090. [Jaroslav Krizek, Feb 05 2010]
Numbers m such that A121559(m) = 0. - Michel Marcus, Aug 22 2014

Examples

			Iteration procedure for a(3) = 5: 5 mod 5 = 0.
Iteration procedure for a(5) = 9: 9 mod 7 = 2, 2 mod 2 = 0.
		

Crossrefs

Cf. A007917 and A064722 (both for the iterations).

Extensions

More terms from Michel Marcus, Aug 22 2014

A175088 Numbers m with result 1 under iterations of {r mod (max prime p <= r)} starting at r = m.

Original entry on oeis.org

1, 4, 6, 8, 12, 14, 18, 20, 24, 27, 30, 32, 35, 38, 42, 44, 48, 51, 54, 57, 60, 62, 65, 68, 72, 74, 77, 80, 84, 87, 90, 93, 95, 98, 102, 104, 108, 110, 114, 117, 119, 121, 125, 128, 132, 135, 138, 140, 143, 145, 147, 150, 152, 155, 158, 161, 164, 168, 171
Offset: 1

Views

Author

Jaroslav Krizek, Jan 28 2010

Keywords

Comments

Terms are composites for all n >= 2.
Complement of A175089. [Jaroslav Krizek, Feb 05 2010]
Numbers m such that A121559(m) = 1. - Michel Marcus, Aug 22 2014

Examples

			Iteration procedure for a(6) = 14: 14 mod 13 = 1.
Iteration procedure for a(10) = 27: 27 mod 23 = 4, 4 mod 3 = 1.
		

Crossrefs

Cf. A007917 and A064722 (both for the iterations).

Programs

  • Mathematica
    (x /. Solve[Fold[Mod[#1, #2] &, x, Reverse[Prime /@ Range[40]]] == 1,
        x, Integers]) /. C[1] -> 0 (* Morgan L. Owens, Jun 22 2016 *)

Extensions

More terms from Michel Marcus, Aug 22 2014

A340902 Distance from the largest prime with less than 10^n decimal digits to 10^(10^n-1).

Original entry on oeis.org

63, 621, 6101, 11333, 59511, 172473
Offset: 1

Views

Author

Jeppe Stig Nielsen, Jan 26 2021

Keywords

Comments

The prime number related to a(n) is the prime immediately preceding the prime related to A096548(n).
a(5) and a(6) appear to have been first found by Patrick De Geest.

Examples

			a(4) = 11333 because 10^9999 - 11333 is the largest prime not exceeding 10^9999.
a(5) = 59511 because 10^99999 - 59511 is the largest prime not exceeding 10^99999.
		

Crossrefs

Formula

a(n) = 10^(10^n-1) - precprime(10^(10^n-1)) = A064722(10^A002283(n)).
Previous Showing 11-19 of 19 results.