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

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

Original entry on oeis.org

1, 3, 4, 6, 8, 10, 11, 12, 14, 16, 17, 18, 20, 22, 23, 24, 26, 27, 29, 30, 32, 34, 35, 37, 38, 40, 41, 42, 44, 46, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 64, 65, 67, 68, 70, 71, 72, 74, 76, 77, 79, 80, 82, 83, 84, 86, 87, 89, 90, 92, 93, 95, 97, 98, 100, 101, 102
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Complement of A175072. Union of A175073 and A175074. [From Jaroslav Krizek, Jan 30 2010]

Examples

			Iteration procedure for a(6) = 10: 10 mod 7 = 3, 3 mod 2 = 1. Iteration procedure for a(7) = 11: 11 mod 7 = 4, 4 mod 3 = 1.
		

Programs

  • Mathematica
    nn1Q[n_]:=Last[NestWhileList[Mod[#,NextPrime[#,-1]]&,n,#>1&]]!=0; Select[ Range[ 110],nn1Q] (* Harvey P. Dale, May 05 2015 *)

A175075 Primes q with result 2 under iterations of {r mod (max prime p < r)} starting at r = q.

Original entry on oeis.org

2, 5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1429, 1453, 1483, 1489
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

a(1) = 2, a(n) = A006512(n-1) for 2 <= n <= 82, a(83) = 2999. Sequence is the union of A006512 and A175080. Subsequence of A175072. Primes q with some results of {2, 28, 36, 52, 58, 66, ... } under first step of iteration of {r mod (max prime p < r)} starting at r = q, i.e. number 2 and primes q such that difference q and previous prime is equal to some of the values 2, 28, 36, 52, 58, 66, ...
Not the same as A094743: contains 2999, 3299, 5147, 5981, 8999, 9587, 10037, 10427, 10559, 10937, 11579, 12889, ... that are absent from that sequence. Up to 10^9, there are 3247366 terms in this sequence that are not in A094743, though every term from that sequence appears here. Is A094743 a subsequence of this sequence? - Charles R Greathouse IV, Jan 12 2022
It suffices to stop after the iterations yield a number less than 5 and check if the result is 2. Under this procedure, 2 takes 0 iterations, 5 is the first prime to take 1 iteration, 29 is the first to take 2 iterations, 2999 is the first to take 3 iterations, and 401429925999155063 is the first to take 4 iterations. - Charles R Greathouse IV, Jan 14 2022

Examples

			Iteration procedure for a(5) = 19: 19 mod 17 = 2. Iteration procedure for a(83) = 2999: 2999 mod 2971 = 28, 28 mod 23 = 5, 5 mod 3 = 2.
		

Programs

  • Mathematica
    fQ[p_] := Block[{r = p}, While[r > 2, r = Mod[r, NextPrime[r, -1]]]; r == 2]; Select[ Prime@ Range@ 253, fQ] (* Robert G. Wilson v, Aug 09 2010 *)
  • PARI
    is(n)=if(!isprime(n), return(0)); while(n>4, n-=precprime(n-1)); n==2 \\ Charles R Greathouse IV, Jan 12 2022
    
  • PARI
    has(n)=while(n>4, n-=precprime(n-1)); n==2
    list(lim)=my(v=List([2]),p=3); forprime(q=5,lim, if(has(q-p), listput(v,q)); p=q); Vec(v) \\ Charles R Greathouse IV, Jan 12 2022

Formula

A175072 \ A175076. [A-number corrected by R. J. Mathar, Sep 25 2010] - Jaroslav Krizek, Jan 30 2010

Extensions

More terms from Robert G. Wilson v, Aug 09 2010
A175080 inserted in comment - R. J. Mathar, Sep 25 2010

A175077 Final number reached by iterating r -> A049711(r) starting at r = n.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

See A175071 for starting n that reach 1, and A175072 for starting n that reach 2.

Examples

			Iteration procedure for n = 6: 6 mod 5 = 1 = a(6).
Iteration procedure for n = 7: 7 mod 5 = 2 = a(7).
		

Crossrefs

Programs

  • Maple
    A151799 := proc(n) prevprime(n) ; end proc:
    A049711 := proc(n) if n <=2 then n; else n-A151799(n) ; end if; end proc:
    A175077 := proc(n) local r ; r := n ; while r > 2 do r := A049711(r) ; end do: r ; end proc:
    seq(A175077(n),n=1..100) ; # R. J. Mathar, Feb 19 2010
  • Mathematica
    f[n_] := Switch[n, 1, 1, 2, 2, _, n - NextPrime[n, -1]];
    a[n_] := FixedPoint[f, n];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 13 2023 *)

Formula

a(A175071(k)) = 1; a(A175072(k)) = 2, any k. - R. J. Mathar, Feb 19 2010
a(n) = A121559(n-1) + 1 for n >= 2. - Pontus von Brömssen, Jul 31 2022

Extensions

More terms from R. J. Mathar, Feb 19 2010

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

A175076 Composites c which end at 2 under iterations of {r mod (max prime p < r)} starting at r = c.

Original entry on oeis.org

9, 15, 21, 25, 28, 33, 36, 39, 45, 49, 52, 55, 58, 63, 66, 69, 75, 78, 81, 85, 88, 91, 94, 96, 99, 105, 111, 115, 118, 120, 122, 126, 129, 133, 136, 141, 144, 146, 148, 153, 156, 159, 162, 165, 169, 172, 175, 178, 183, 186, 188, 190, 195, 201, 204, 206, 208, 213, 216
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Subsequence of A175072. Union of a(n) and A175075 is A175072.

Examples

			Iteration procedure for a(2) = 15: 15 mod 13 = 2. Iteration procedure for a(5) = 28: 28 mod 23 = 5, 5 mod 3 = 2.
		

Programs

  • Mathematica
    ce2Q[n_]:=NestWhileList[Mod[#,NextPrime[#,-1]]&,n,#>0&][[-2]]==2; Select[ Range[ 300],CompositeQ[#]&&ce2Q[#]&] (* Harvey P. Dale, Feb 09 2015 *)

Extensions

More terms from R. J. Mathar, Sep 25 2010

A175079 The smallest natural numbers m with first occurrence 0, 1, 2, 3, ... for number of steps of iterations of {r mod (max prime p < r)} needed to reach 1 or 2 starting at r = m.

Original entry on oeis.org

1, 3, 10, 123, 1357324
Offset: 0

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

I offer a prize of 100 liters of Pilsner Urquell to the discoverer of a(5). Conjecture: a(n) is not equal A135543(n) + 1 for all n >= 1. See A175071 (natural numbers m with result 1) and A175072 (natural numbers m with result 2). See A175077 (results 1 or 2 under iterations) and A175078 (number of steps of iterations).

Examples

			Iteration for a(4) = 1357324 has 4 steps: 1357324 mod 1357201 = 123, 123 mod 113 = 10, 10 mod 7 = 3, 3 mod 2 = 1.
		

Crossrefs

Formula

From Pontus von Brömssen, Jul 31 2022: (Start)
a(n) = A135543(n) + 1 for n >= 1, i.e., the conjecture in the Comments is false. This follows from the result that A175078(n) = A121561(n-1) for n >= 2.
a(5) = A135543(5) + 1 <= A002110(8787)/510510 + 291362 (see comment in A135543).
(End)

Extensions

Jaroslav Krizek, Jan 30 2010
Showing 1-6 of 6 results.