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

A121559 Final result (0 or 1) under iterations of {r mod (max prime p <= r)} starting at r = n.

Original entry on oeis.org

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

Views

Author

Kerry Mitchell, Aug 07 2006

Keywords

Comments

Previous name: Find r1 = n modulo p1, where p1 is the largest prime not greater than n. Then find r2 = r1 modulo p2, where p2 is the largest prime not greater than r1. Repeat until the last r is either 1 or 0; a(n) is the last r value.
The sequence has the form of blocks of 0's between 1's. See sequence A121560 for the lengths of the blocks of zeros.
The function r mod (max prime p <= r), which appears in the definition, equals r - (max prime p <= r) = A064722(r), because p <= r < 2*p by Bertrand's postulate, where p is the largest prime less than or equal to r. - Pontus von Brömssen, Jul 31 2022

Examples

			a(9) = 0 because 7 is the largest prime not larger than 9, 9 mod 7 = 2, 2 is the largest prime not greater than 2 and 2 mod 2 = 0.
		

Crossrefs

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

Programs

  • Mathematica
    Abs[Table[FixedPoint[Mod[#,NextPrime[#+1,-1]]&,n],{n,110}]] (* Harvey P. Dale, Mar 17 2023 *)
  • PARI
    a(n) = if (n==1, return (1)); na = n; while((nb = (na % precprime(na))) > 1, na = nb); return(nb); \\ Michel Marcus, Aug 22 2014

Formula

a(p) = 0 when p is prime. - Michel Marcus, Aug 22 2014
a(n) = A175077(n+1) - 1. - Pontus von Brömssen, Jul 31 2022
a(n) = A200947(n) mod 2. - Alois P. Heinz, Jun 12 2023

Extensions

New name from Michel Marcus, Aug 22 2014

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

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