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.

A092829 a(n) is the solution of the equation A081943(x) =n (a(A081943(n)) =n).

Original entry on oeis.org

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

Views

Author

Farideh Firoozbakht, Apr 15 2004

Keywords

Comments

For each n number of solutions of the equation A081943(x) =n is less than 2 because the terms of the sequence A081943 are distinct.

Examples

			a(25) =35 because A081943(35) =25.
		

Crossrefs

A073666 Rearrangement of natural numbers such that a(k)*a(k+1) + 1 is a prime for all k.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Aug 10 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[1]=1; a[n_]:=a[n]=(For[c=Sort[Table[a[k], {k, n-1}]]; d=Append[c, Last[c]+1]; m=First[Complement[Range[Last[d]], c]], MemberQ[c, m]||!PrimeQ[m*a[n-1]+1], m++ ]; m); Table[a[k], {k, 70}] (* Farideh Firoozbakht, Apr 14 2004 *)
  • PARI
    A073666(n,show=1,a=1,u=[a])={for(n=2,n,show&&print1(a",");for(k=u[1]+1,9e9,!setsearch(u,k) && isprime(a*k+1) && (a=k) && break);u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1,u=u[2..-1]));a} \\ Use 2nd, 3rd or 4th optional arg to display intermediate terms, to use another starting value, to exclude some terms. - M. F. Hasler, Nov 24 2015

Extensions

More terms from Jason Earls, Aug 26 2002
Offset changed to 1 by Ivan Neretin, Mar 06 2016

A257218 Lexicographically earliest sequence of distinct positive integers such that gcd(a(n), a(n-1)) takes no value more than twice.

Original entry on oeis.org

1, 2, 3, 6, 4, 8, 10, 5, 15, 9, 18, 12, 16, 24, 30, 20, 40, 32, 48, 36, 27, 54, 72, 60, 45, 75, 25, 50, 70, 7, 14, 28, 42, 21, 63, 126, 84, 56, 112, 64, 96, 120, 80, 100, 150, 90, 108, 81, 162, 216, 144, 168, 140, 35, 105, 210, 180, 135, 225, 300
Offset: 1

Views

Author

Ivan Neretin, Apr 18 2015

Keywords

Comments

Presumably a(n) is a permutation of the positive integers.
Primes seem to occur in their natural order. 31 appears as a(7060). Primes p >= 37 are not found among the first 10000 terms.
Numbers n such that a(n)=n are 1, 2, 3, 12, 306, ...
A256918(n) = gcd(a(n), a(n+1)); gcd(a(A257120(n)), a(A257120(n)+1)) = gcd(a(A257475(n)), a(A257475(n)-1)) = n. - Reinhard Zumkeller, Apr 25 2015
For p prime: A257122(p)-1 = index of the smallest multiple of p: a(A257122(p)-1) mod p = 0 and a(m) mod p > 0 for m < A257122(p)-1. - Reinhard Zumkeller, Apr 26 2015

Examples

			After a(9)=15, the values 1, 2, 3, 4, 6, and 8 are already used, while 7 is forbidden because gcd(15,7)=1 and that value of GCD has already occurred twice, at (1,2) and (2,3). The minimal value which is neither used not forbidden is 9, so a(10)=9.
		

Crossrefs

Other minimal sequences of distinct positive integers that match some condition imposed on a(n) and a(n-1):
A175498 (differences are unique),
A081145 (absolute differences are unique),
A235262 (bitwise XORs are unique),
A163252 (differ by one bit in binary),
A000027 (GCD=1),
A064413 (GCD>1),
A128280 (sum is a prime),
A034175 (sum is a square),
A175428 (sum is a cube),
A077220 (sum is a triangular number),
A073666 (product plus 1 is a prime),
A081943 (product minus 1 is a prime),
A091569 (product plus 1 is a square),
A100208 (sum of squares is a prime).
Cf. A004526.
Cf. A256918, A257120, A257475, A257478, A257122 (putative inverse).
Cf. also A281978.

Programs

  • Haskell
    import Data.List (delete); import Data.List.Ordered (member)
    a257218 n = a257218_list !! (n-1)
    a257218_list = 1 : f 1 [2..] a004526_list where
       f x zs cds = g zs where
         g (y:ys) | cd `member` cds = y : f y (delete y zs) (delete cd cds)
                  | otherwise       = g ys
                  where cd = gcd x y
    -- Reinhard Zumkeller, Apr 24 2015
  • Mathematica
    a={1}; used=Array[0&,10000]; Do[i=1; While[MemberQ[a,i] || used[[l=GCD[a[[-1]],i]]]>=2, i++]; used[[l]]++; AppendTo[a,i], {n,2,100}]; a (* Ivan Neretin, Apr 18 2015 *)

A081942 a(1) = 1, a(n) = smallest number greater than a(n-1) such that a(n-1)*a(n) + 1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 10, 13, 24, 25, 28, 34, 37, 40, 43, 46, 51, 56, 60, 67, 70, 79, 84, 87, 94, 105, 106, 120, 126, 130, 133, 136, 147, 148, 151, 156, 161, 162, 163, 166, 171, 176, 177, 184, 190, 193, 204, 208, 211, 228, 234, 239, 242, 248, 252, 256, 262, 265, 270
Offset: 1

Views

Author

Amarnath Murthy, Apr 02 2003

Keywords

Comments

See A073666 for a nonincreasing version and A096100 for a more restrictive constraint. - M. F. Hasler, Nov 24 2015

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{k = m = s[[-1]]}, k++; While[ !PrimeQ[k*m + 1], k++]; Append[s, k]]; Nest[f, {1}, 57] (* Robert G. Wilson v, Dec 02 2012 *)
    smp[n_]:=Module[{m=n+1},While[!PrimeQ[m*n+1],m++];m]; NestList[smp,1,60] (* Harvey P. Dale, Dec 12 2018 *)
  • PARI
    A081942(n,show=0,a=1)={for(n=2,n,show&&print1(a",");for(k=a+1,9e9, isprime(a*k+1) && (a=k) && break));a} \\ Use 2nd or 3rd optional arg to print intermediate terms or to use another starting value. - M. F. Hasler, Nov 24 2015

Extensions

More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 08 2003

A308334 Lexicographically earliest sequence of distinct positive numbers such that for any n > 0, a(n) OR a(n+1) is a prime number (where OR denotes the bitwise OR operator).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 20 2019

Keywords

Comments

By Dirichlet's theorem on arithmetic progressions, we can always extend the sequence: say a(n) < 2^k, then a(n) OR 1 and 2^k are coprime and there are infinitely many prime numbers of the form (a(n) OR 1) + m*2^k = a(n) OR (1 + m*2^k) and we can extend the sequence.
Will every integer appear in this sequence?
Numerous sequences are based on the same model: the sequence is the lexicographically earliest sequence of distinct positive terms such that some function in two variables yields prime numbers when applied to consecutive terms:
f(u,v) Analog sequence
------- -----------------
u OR v a (this sequence)
u + v A055265
u*v + 1 A073666
u*v - 1 A081943
abs(u-v) A065186
max(u,v) A282649
u^2 + v^2 A100208
The appearance of numbers much earlier or later than their corresponding index is flagged strikingly in the plot2 graph of a(n)/n (see links). - Peter Munn, Sep 10 2022

Examples

			The first terms, alongside a(n) OR a(n+1), are:
  n   a(n)  a(n) OR a(n+1)
  --  ----  --------------
   1     1               3
   2     2               3
   3     3               7
   4     4               5
   5     5               7
   6     6               7
   7     7              23
   8    16              29
   9    13              13
  10     8              11
  11    11              11
  12     9              11
		

Crossrefs

See A308340 for the corresponding prime numbers.
See A055265, A065186, A073666, A081943, A100208, A282649 for similar sequences.

Programs

  • PARI
    s=0; v=1; for (n=1, 67, s+=2^v; print1 (v ", "); for (w=1, oo, if (!bittest(s,w) && isprime(o=bitor(v,w)), v=w; break)))
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen():
        aset, k, mink = {1}, 1, 2
        for n in count(1):
            an = k; yield an; aset.add(an)
            s, k = set(str(an)), mink
            while k in aset or not isprime(an|k): k += 1
            while mink in aset: mink += 1
    print(list(islice(agen(), 67))) # Michael S. Branicky, Sep 10 2022

A092842 a(n) is the solution of the equation A073666(x) = n (A073666(a(n)) = n).

Original entry on oeis.org

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

Views

Author

Farideh Firoozbakht, Apr 15 2004

Keywords

Comments

For each n number of solutions of the equation A073666(x) =n is less than 2 because the terms of the sequence A073666 are distinct. Conjecture: This sequence is infinite(see A073666).

Crossrefs

Showing 1-6 of 6 results.