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

A073660 Terms of A073659 which retain their relative positions.

Original entry on oeis.org

1, 2, 4, 6, 12, 22, 26, 42, 58, 64, 96, 110, 128, 156, 216, 234, 242, 268, 298, 310, 330, 356, 380, 384, 408, 422, 424, 454, 462, 468, 490, 516, 580, 634, 648, 664, 708, 806, 824, 826, 864, 894, 896, 986, 1038, 1114, 1122, 1160, 1244, 1246, 1254, 1264, 1316, 1420
Offset: 1

Views

Author

Amarnath Murthy, Aug 10 2002

Keywords

Crossrefs

Cf. A073659.

Extensions

More terms from Sascha Kurz, Jan 28 2003

A291546 a(n) = Sum_{k=1..n} A073659(k).

Original entry on oeis.org

1, 3, 7, 13, 23, 31, 43, 59, 73, 97, 127, 149, 167, 193, 227, 263, 283, 311, 349, 389, 421, 463, 509, 557, 601, 653, 709, 769, 823, 881, 947, 997, 1061, 1123, 1193, 1277, 1367, 1439, 1531, 1607, 1693, 1787, 1861, 1949, 2017, 2099, 2179, 2281, 2377, 2477
Offset: 1

Views

Author

Seiichi Manyama, Aug 26 2017

Keywords

Comments

For n > 1, a(n) is a prime.

Crossrefs

Cf. A000040, A008578, A073659. Apart from the first term the same as A291544.

Programs

  • Mathematica
    a = {1}; Do[k = 2; While[Or[! PrimeQ[Total@ a + k], MemberQ[a, k]], k += 2]; AppendTo[a, k], {49}]; Accumulate@ a (* Michael De Vlieger, Aug 26 2017, after Jayanta Basu at A073659 *)
  • PARI
    v=[1]; n=1; vp=[1]; while(n<200, if(isprime(p=n+vecsum(v)) && !vecsearch(vecsort(v), n), v=concat(v, n); vp = concat(vp, p); n=0); n++); vp \\ Michel Marcus, Aug 26 2017

A055265 a(n) is the smallest positive integer not already in the sequence such that a(n)+a(n-1) is prime, starting with a(1)=1.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, May 09 2000

Keywords

Comments

The sequence is well-defined (the terms must alternate in parity, and by Dirichlet's theorem a(n+1) always exists). - N. J. A. Sloane, Mar 07 2017
Does every positive integer eventually occur? - Dmitry Kamenetsky, May 27 2009. Reply from Robert G. Wilson v, May 27 2009: The answer is almost certainly yes, on probabilistic grounds.
It appears that this is the limit of the rows of A051237. That those rows do approach a limit seems certain, and given that that limit exists, that this sequence is the limit seems even more likely, but no proof is known for either conjecture. - Robert G. Wilson v, Mar 11 2011, edited by Franklin T. Adams-Watters, Mar 17 2011
The sequence is also a particular case of "among the pairwise sums of any M consecutive terms, N are prime", with M = 2, N = 1. For other M, N see A055266 & A253074 (M = 2, N = 0), A329333, A329405 - A329416, A329449 - A329456, A329563 - A329581, and the OEIS Wiki page. - M. F. Hasler, Feb 11 2020

Examples

			a(5) = 7 because 1, 2, 3 and 4 have already been used and neither 4 + 5 = 9 nor 4 + 6 = 10 are prime while 4 + 7 = 11 is prime.
		

Crossrefs

Inverse permutation: A117922; fixed points: A117925; A117923=a(a(n)). - Reinhard Zumkeller, Apr 03 2006
Cf. A086527 (the primes a(n)+a(n-1)).
Cf. A070942 (n's such that a(1..n) is a permutation of (1..n)). - Zak Seidov, Oct 19 2011
See also A076990, A243625.
See A282695 for deviation from identity sequence.
A073659 is a version where the partial sums must be primes.

Programs

  • Haskell
    import Data.List (delete)
    a055265 n = a055265_list !! (n-1)
    a055265_list = 1 : f 1 [2..] where
       f x vs = g vs where
         g (w:ws) = if a010051 (x + w) == 1
                       then w : f w (delete w vs) else g ws
    -- Reinhard Zumkeller, Feb 14 2013
    
  • Maple
    A055265 := proc(n)
        local a,i,known ;
        option remember;
        if n =1 then
            1;
        else
            for a from 1 do
                known := false;
                for i from 1 to n-1 do
                    if procname(i) = a then
                        known := true;
                        break;
                    end if;
                end do:
                if not known and isprime(procname(n-1)+a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A055265(n),n=1..100) ; # R. J. Mathar, Feb 25 2017
  • Mathematica
    f[s_List] := Block[{k = 1, a = s[[ -1]]}, While[ MemberQ[s, k] || ! PrimeQ[a + k], k++ ]; Append[s, k]]; Nest[f, {1}, 71] (* Robert G. Wilson v, May 27 2009 *)
    q=2000; a={1}; z=Range[2,2*q]; While[Length[z]>q-1, k=1; While[!PrimeQ[z[[k]]+Last[a]], k++]; AppendTo[a,z[[k]]]; z=Delete[z,k]]; Print[a] (*200 times faster*) (* Vladimir Joseph Stephan Orlovsky, May 03 2011 *)
  • PARI
    v=[1];n=1;while(n<50,if(isprime(v[#v]+n)&&!vecsearch(vecsort(v),n), v=concat(v,n);n=0);n++);v \\ Derek Orr, Jun 01 2015
    
  • PARI
    U=-a=1; vector(100,k, k=valuation(1+U+=1<M. F. Hasler, Feb 11 2020

Formula

a(2n-1) = A128280(2n-1) - 1, a(2n) = A128280(2n) + 1, for all n >= 1. - M. F. Hasler, Feb 11 2020

Extensions

Corrected by Hans Havermann, Sep 24 2002

A054408 a(n) = smallest positive integer not already in sequence such that the partial sum a(1)+...+a(n) is prime.

Original entry on oeis.org

2, 1, 4, 6, 10, 8, 12, 16, 14, 24, 30, 22, 18, 26, 34, 36, 20, 28, 38, 40, 32, 42, 46, 48, 44, 52, 56, 60, 54, 58, 66, 50, 64, 62, 70, 84, 90, 72, 92, 76, 86, 94, 74, 88, 68, 82, 80, 102, 96, 100, 114, 98, 78, 112, 120, 110, 108, 106, 126, 122, 130, 132, 134, 124, 128, 118
Offset: 1

Views

Author

Henry Bottomley, May 09 2000

Keywords

Comments

1 is the only odd number in this sequence. - Derek Orr, Feb 07 2015
Conjecture: Every even numbers appears. - N. J. A. Sloane, May 29 2017

Crossrefs

Cf. A254337.
See A073659 for another version.
In A055265 only pairs of adjacent terms add to primes.

Programs

  • Mathematica
    t = {2}; Do[i = 1; While[! PrimeQ[Total[t] + i] || MemberQ[t, i], i++]; AppendTo[t, i], {65}]; t (* Jayanta Basu, Jul 04 2013 *)
  • PARI
    v=[2];n=1;while(n<100,if(isprime(vecsum(v)+n)&&!vecsearch(vecsort(v),n),v=concat(v,n);n=0);n++);v \\ Derek Orr, Feb 07 2015
    
  • Python
    from sympy import isprime
    def aupton(terms):
        alst, aset, asum = [], set(), 0
        while len(alst) < terms:
            an = 1
            while True:
                while an in aset: an += 1
                if isprime(asum + an):
                    alst, aset, asum = alst + [an], aset | {an}, asum + an
                    break
                an += 1
        return alst
    print(aupton(66)) # Michael S. Branicky, Jun 05 2021

A075574 a(1) = 1, then the smallest number (obviously even) greater than the previous term such that every partial sum is prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 16, 18, 26, 30, 36, 48, 52, 54, 56, 58, 60, 66, 74, 78, 88, 90, 96, 104, 106, 108, 122, 126, 144, 154, 156, 158, 172, 188, 190, 192, 206, 210, 214, 228, 240, 242, 250, 258, 260, 262, 284, 286, 288, 290, 298, 300, 302, 318, 324, 328, 332, 340
Offset: 1

Views

Author

Amarnath Murthy, Sep 25 2002

Keywords

Crossrefs

Programs

  • Maple
    A075574:=proc(n) local i,j,k,t,s; j:=1; s:=1; t:=1; for i to n do k:=s; s:=nextprime(s+j); j:=s-k; t:=t,j; od; t; end; # Floor van Lamoen, Oct 21 2005
  • Mathematica
    nxt[{ps_,a_}]:=Module[{c=a+2},While[!PrimeQ[ps+c],c+=2];{ps+c,c}]; Join[ {1},NestList[nxt,{3,2},60][[All,2]]] (* Harvey P. Dale, Sep 19 2021 *)

Extensions

More terms from David Wasserman, Jan 20 2005

A256270 a(1) = 1; for n > 1, a(n) is the smallest positive integer not already in the sequence such that a(1)^2 + a(2)^2 + ... + a(n)^2 is prime.

Original entry on oeis.org

1, 2, 6, 24, 12, 54, 18, 36, 30, 48, 60, 84, 42, 90, 66, 72, 96, 78, 120, 126, 102, 150, 144, 108, 156, 114, 138, 132, 180, 204, 210, 168, 186, 192, 234, 174, 162, 216, 198, 222, 246, 228, 264, 348, 240, 270, 300, 330, 336, 402, 390, 414, 288, 306, 258, 294, 318, 324, 276, 252, 372, 426, 366, 282, 432, 354, 378
Offset: 1

Views

Author

Derek Orr, Jun 01 2015

Keywords

Comments

1 is the only odd number in this sequence.
Excluding 1 and 2, this is a permutation of the positive multiples of 6.

Crossrefs

Programs

  • PARI
    v=[1];n=1;while(n<10^3,if(isprime(n^2+sum(i=1,#v,v[i]^2))&&!vecsearch(vecsort(v),n),v=concat(v,n);n=1);n++);v

Formula

a(n)^2 = A073852(n).

A287662 a(n) is the smallest positive integer not already in sequence such that a(1) + ... + a(n) is a prime power, with a(1) = 1.

Original entry on oeis.org

1, 2, 4, 6, 3, 7, 8, 10, 12, 11, 9, 16, 14, 18, 28, 20, 22, 32, 33, 13, 24, 38, 30, 36, 34, 26, 42, 48, 40, 44, 46, 50, 60, 52, 68, 54, 58, 5, 15, 64, 78, 56, 66, 70, 74, 76, 84, 62, 72, 82, 90, 80, 55, 21, 92, 106, 104, 88, 98, 100, 96, 108, 102, 86, 114, 94, 116, 118, 122, 120, 130, 126, 107, 31, 132, 138
Offset: 1

Views

Author

Ilya Gutkovskiy, May 29 2017

Keywords

Comments

It appears that the sequence contains all even numbers.

Examples

			a(8) = 10 because 1, 2, 3, 4, 6, 7 and 8 have already been used in the sequence, 1 + 2 + 4 + 6 + 3 + 7 + 8 + 5 = 36 is not prime power, 1 + 2 + 4 + 6 + 3 + 7 + 8 + 9 = 40 is not prime power while 1 + 2 + 4 + 6 + 3 + 7 + 8 + 10 = 41 is a prime power.
		

Crossrefs

Programs

  • Mathematica
    t = {1}; Do[i = 1; While[! PrimePowerQ[Total[t] + i] || MemberQ[t, i], i++]; AppendTo[t, i], {75}]; t

A356188 a(1)=1; for n > 1, if a(n-1) is prime then a(n) = the smallest number not yet in the sequence. Otherwise a(n) = a(n-1) + n - 1.

Original entry on oeis.org

1, 2, 3, 4, 8, 13, 5, 6, 14, 23, 7, 9, 21, 34, 48, 63, 79, 10, 28, 47, 11, 12, 34, 57, 81, 106, 132, 159, 187, 216, 246, 277, 15, 48, 82, 117, 153, 190, 228, 267, 307, 16, 58, 101, 17, 18, 64, 111, 159, 208, 258, 309, 361, 414, 468, 523, 19, 20, 78, 137, 22, 83, 24, 87, 151, 25, 91
Offset: 1

Views

Author

John Tyler Rascoe, Jul 28 2022

Keywords

Examples

			a(8) = 6 because a(7) is prime and 6 is the smallest number that has not appeared in the sequence thus far.
a(9) = 6 + 9 - 1 = 14 because a(8) is not prime.
		

Crossrefs

Programs

  • Mathematica
    f[s_] := Module[{k=1, t}, t = If[!PrimeQ[s[[-1]]], s[[-1]] + Length[s], While[!FreeQ[s, k], k++]; k]; Join[s, {t}]]; Nest[f, {1}, 66] (* Amiram Eldar, Sep 28 2022 *)
  • Python
    from sympy import isprime
    from itertools import count, filterfalse
    A356188 = A = [1]
    for n in range(1,100):
          if isprime(A[-1]):
                y = next(filterfalse(set(A)._contains_, count(1)))
          else:
                y = A[-1] + n
          A.append(y)
Showing 1-8 of 8 results.