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.

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

Original entry on oeis.org

2, 5, 7, 9, 13, 15, 19, 21, 25, 28, 31, 33, 36, 39, 43, 45, 49, 52, 55, 58, 61, 63, 66, 69, 73, 75, 78, 81, 85, 88, 91, 94, 96, 99, 103, 105, 109, 111, 115, 118, 120, 122, 126, 129, 133, 136, 139, 141, 144, 146, 148, 151
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Complement of A175071.
Union of A175075 and A175076. [From Jaroslav Krizek, Jan 30 2010, A-numbers corrected R. J. Mathar, Feb 19 2010]

Examples

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

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

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

Original entry on oeis.org

3, 11, 17, 23, 29, 37, 41, 47, 53, 59, 67, 71, 79, 83, 89, 97, 101, 107, 113, 127, 131, 137, 149, 157, 163, 167, 173, 179, 191, 197, 211, 223, 227, 233, 239, 251, 257, 263, 269, 277, 281, 293, 307
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Subsequence of A175071.
Union of a(n) and A175074 is A175071. - Jaroslav Krizek, Jan 30 2010
The terms in A025584 but not in here are 2, 2999, 3299, 5147, 5981, 8999, 9587, ... , apparently those listed in A175080. - R. J. Mathar, Feb 01 2010
a(n-1)=A156828(n) in the range n=3..348, but afterwards the sequences differ because numbers like 2999 and 3229 are in A156828 but not in here. - R. J. Mathar, Mar 01 2010
Conjecture: under this iteration procedure, all primes eventually will yield either a 2 or a 1. If a 2 results, all subsequent terms are zeros; if a 1 results, all subsequent terms are -1s. The conjecture is true for the first 2 million primes. - Harvey P. Dale, Jan 17 2014

Examples

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

Crossrefs

Note that all three of A025584, A156828, A175073 are different sequences. - N. J. A. Sloane, Apr 10 2011

Programs

  • Maple
    isA175073 := proc(p)
        local r,rold;
        if not isprime(p) then
            return false;
        end if;
        r := p ;
        while true do
            rold :=r ;
            if r = 2 then
                return false ;
            end if;
            r := modp(r,prevprime(r)) ;
            if r = 1 then
                return true;
            elif r= rold then
                return false ;
            end if;
        end do:
    end proc:
    A175073 := proc(n)
        option remember ;
        if n= 1 then
            3;
        else
            for p from procname(n-1)+2 by 2 do
                if isA175073(p) then
                    return p;
                end if;
            end do:
        end if;
    end proc:
    seq(A175073(n),n=1..40) ; # R. J. Mathar, Mar 25 2024
  • Mathematica
    r1Q[n_] := FixedPoint[Mod[#, NextPrime[#, -1]] &, n] == -1; Select[Prime[ Range[70]],r1Q] (* This program relies upon the conjecture described in the comments above *) (* Harvey P. Dale, Jan 17 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

A175074 Nonprimes b with result 1 under iterations of {r mod (max prime p < r)} starting at r = b.

Original entry on oeis.org

1, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 27, 30, 32, 34, 35, 38, 40, 42, 44, 46, 48, 50, 51, 54, 56, 57, 60, 62, 64, 65, 68, 70, 72, 74, 76, 77, 80, 82, 84, 86, 87, 90, 92, 93, 95, 98, 100, 102
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Subsequence of A175071. Union of a(n) and A175073 is A175071.
Union of a(n) and A175073 is A175071. [From Jaroslav Krizek, Jan 30 2010]

Examples

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

Programs

  • Mathematica
    np1Q[n_]:=!PrimeQ[n]&&MemberQ[NestWhileList[Mod[#,NextPrime[#,-1]]&,n,#>0&],1]; Select[Range[150],np1Q] (* Harvey P. Dale, Jun 27 2020 *)

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.