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.

A076045 Primes that are three term sums of A076990.

Original entry on oeis.org

7, 11, 17, 19, 17, 19, 29, 37, 41, 37, 41, 47, 53, 47, 53, 59, 67, 71, 79, 83, 89, 79, 71, 73, 79, 73, 79, 97, 109, 107, 101, 107, 113, 107, 109, 113, 137, 139, 137, 139, 149, 163, 157, 149, 151, 167, 173, 163, 167, 163, 179, 167, 157, 163, 181, 193
Offset: 1

Views

Author

David Garber, Nov 02 2002

Keywords

Examples

			a(1)=1+2+4=7; a(2)=2+4+5=11; a(3)=4+5+8=17; etc
		

Crossrefs

Cf. A076990.

Formula

Let b(n) be A076990 then a(n)=b(n)+b(n+1)+b(n+2).

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

A297673 Triangular array T(n, k) read by rows, n > 0, 0 < k <= n: T(n, k) = least unused positive value (reading rows from left to right) such that T(n, k) + T(n+1, k) + T(n+1, k+1) is prime.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 03 2018

Keywords

Comments

See A296305 for the corresponding sums.
Each term may be involved in up to three sums:
- T(1, 1) is involved in one sum,
- For any n > 1, T(n, 1) and T(n, k) are involved in two sums:
- For any n > 1 and k such that 1 < k < n, T(n, k) is involved in three sums.
The parity of the terms of the triangle has interesting features:
- For any n > 35:
- T(n, 1) is even,
- T(n, k) is odd for any k such that 1 < k < n - 34,
- T(n, n - 34) is even,
- T(n, n - k) and T(n + 64, n + 64 - k) have the same parity for k=0..34,
- See representation in Links section (the black pattern visible alongside the right border is eventually periodic),
- These features also appear in the scatterplot of the triangle as a flat sequence in the form of two branches: the first branch above the X=Y axis corresponds to the (frequent) odd terms, and the dashed branch under the X=Y axis corresponds to the (sparse) even terms.
This triangle has building features in common with A073671 and with A076990:
- for three distinct positive numbers to sum to a prime number, either all of them are odd or two of them are even and the other is odd,
- we have both situations here,
- we have only the first situation in A073671,
- we have only the second situation in A076990.
See also A297615 for a similar triangle.

Examples

			Triangle begins:
   1:                       1
   2:                     2,  4
   3:                   3,  6,  7
   4:                 5,  9,  8, 14
   5:              10, 16, 12, 11, 18
   6:            13, 20, 17, 24, 26, 15
   7:          19, 21, 30, 32, 23, 22, 34
   8:        25, 27, 31, 28, 29, 37, 38, 35
   9:      33, 39, 41, 55, 44, 36, 40, 49, 43
  10:    42, 52, 46, 50, 58, 47, 48, 51, 57, 63
The term T(1, 1) = 1 is involved in the following sum:
- 1 + 2 + 4 = 7.
The term T(3, 3) = 7 is involved in the following sums:
- 4 + 6 + 7 = 17,
- 7 + 8 + 14 = 29.
The term T(4, 2) = 9 is involved in the following sums:
- 3 + 5 + 9 = 17,
- 6 + 9 + 8 = 23,
- 9 + 16 + 12 = 37.
		

Crossrefs

Programs

  • PARI
    See Links section.

A075988 Number of integers k satisfying 1 <= k <= n and 0 < frac(n/k) < 1/2, where frac(n/k) is the fractional part of n/k; i.e., frac(n/k) = n/k - floor(n,k).

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 3, 2, 3, 4, 4, 4, 7, 5, 5, 8, 9, 6, 10, 8, 10, 12, 10, 10, 14, 13, 13, 13, 15, 13, 19, 16, 16, 18, 16, 17, 24, 20, 18, 20, 23, 21, 25, 23, 23, 25, 25, 23, 30, 26, 28, 30, 28, 26, 30, 30, 34, 34, 32, 28, 37, 35, 31, 36, 37, 37, 41, 35, 37, 37, 41, 38, 46, 42, 40
Offset: 1

Views

Author

Clark Kimberling, Sep 28 2002

Keywords

Crossrefs

Programs

  • Magma
    [&+[(Ceiling(n/k)-Round(n/k)): k in [1..n]]: n in [1..80]]; // Vincenzo Librandi, Jul 30 2017
    
  • PARI
    a(n) = sum(k=1, n, f = frac(n/k); f  && (f < 1/2)); \\ Michel Marcus, Jul 30 2017

Formula

Sum_{k=1..n} (ceiling(n/k) - round(n/k)). - Vladeta Jovovic, Mar 01 2004

A297706 Lexicographically earliest sequence of distinct positive terms such that for any n > 0, a(n) XOR a(n+1) XOR a(n+2) is prime (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

1, 2, 4, 3, 5, 11, 9, 7, 12, 6, 8, 13, 14, 16, 15, 18, 10, 19, 20, 22, 17, 24, 26, 21, 28, 30, 29, 38, 36, 31, 40, 32, 23, 42, 34, 25, 44, 48, 27, 41, 33, 35, 39, 43, 37, 51, 45, 49, 53, 47, 63, 57, 59, 55, 67, 61, 69, 77, 65, 75, 73, 81, 87, 79, 91, 71, 83
Offset: 1

Views

Author

Rémy Sigrist, Jan 03 2018

Keywords

Comments

See A297879 for the corresponding prime numbers.
This sequence has connections with A076990: here we combine triples of successive terms with the XOR operator, there with the usual addition operator.
The sequence alternates long runs of odd terms and long runs with periodic parity (even, even, odd); changes from one type of run to the other occur near terms such that a(n) XOR a(n+1) XOR a(n+2) = 2; see illustration in Links section.

Examples

			The first terms of the sequence are:
    n     a(n)      a(n) XOR a(n+1) XOR a(n+2)
  --    ----      --------------------------
   1       1       7
   2       2       5
   3       4       2
   4       3      13
   5       5       7
   6      11       5
   7       9       2
   8       7      13
   9      12       2
  10       6       3
  11       8      11
  12      13      19
  13      14      17
  14      16      13
  15      15      23
  16      18      11
  17      10      13
  18      19      17
  19      20      19
  20      22      31
		

Crossrefs

Programs

  • PARI
    See Links section.

A330424 a(1) = 1, a(2) = 2; thereafter a(n) = smallest number not occurring earlier such that both the sum of three successive terms and the sum of three successive digits are prime numbers.

Original entry on oeis.org

1, 2, 4, 5, 8, 6, 3, 20, 14, 25, 44, 34, 49, 68, 32, 27, 24, 10, 67, 60, 12, 29, 26, 52, 41065, 62, 50, 61, 40, 30, 43, 64, 72, 21, 46, 16, 41, 22, 38, 23, 28, 122, 7, 82, 18, 81, 2012, 218, 21021, 84, 58, 69, 2002, 90, 201, 106, 76, 47, 88, 128, 1223, 2038
Offset: 1

Views

Author

Eric Angelini and Lars Blomberg, Dec 14 2019

Keywords

Examples

			After 8 and 6 the next term is 3 as 8+6+3 = 17 is a prime;
after 6 and 3 the next term is 20 as 6+3+20 = 29 and 6+3+2=11 are both primes;
after 3 and 20 the next term is 14 as 3+20+14 = 37 and 3+2+0=5 are both primes;
etc.
		

Crossrefs

Cf. A076990 (only the sum of three successive terms is prime).

A330434 a(1) = 1, a(2) = 2; thereafter a(n) = smallest number not occurring earlier such that the sum of three successive digits is prime.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Carole Dubois, Dec 14 2019

Keywords

Examples

			After 8 and 6 the next term is 3 as 8+6+3 = 17 is a prime;
After 6 and 3 the next term is 20 as 6+3+2 = 11 and 3+2+0 = 5 are primes;
After 20 the next term is 9 as 2+0+9 = 11 is a prime; etc.
		

Crossrefs

Cf. A076990 (3 successive terms have a prime sum), A330424 (3 successive terms AND 3 successive digits have a prime sum).

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 3}, While[Nand[FreeQ[#, k], AllTrue[Table[Total@ #[[i ;; i + 2]], {i, Length@ # - 2}], PrimeQ] &@ Flatten@ IntegerDigits@ Append[#, k] ], k++]; k]] &, {1, 2}, 80] (* Michael De Vlieger, Dec 14 2019 *)

A354964 a(1) = 1, a(2) = 2, a(3) = 3; for n > 3, a(n) is the smallest new number such that the sum of any four successive terms is prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 13, 17, 9, 8, 19, 11, 15, 14, 21, 23, 25, 10, 31, 35, 27, 16, 29, 37, 45, 20, 47, 39, 33, 12, 43, 49, 53, 6, 41, 51, 59, 22, 61, 55, 73, 34, 65, 57, 67, 38, 71, 63, 69, 24, 77, 81, 75, 18, 83, 87, 89, 48, 93, 101, 95, 28
Offset: 1

Views

Author

Zak Seidov, Jun 13 2022

Keywords

Crossrefs

See A055265 and A076990 for similar sequences.

Programs

  • Mathematica
    s = {1, 2, 3}; Do[a = s[[-1]] + s[[-2]] + s[[-3]]; n = 4; While[MemberQ[s, n] || ! PrimeQ[a + n], n++]; AppendTo[s, n], {120}]; s
  • PARI
    { s = 0; for (n=1, #a = vector(62), if (n<=3, a[n]=n, for (v=1, oo, if (!bittest(s,v) && isprime(v+a[n-1]+a[n-2]+a[n-3]), a[n]=v; break))); print1 (a[n]", "); s+=2^a[n]) } \\ Rémy Sigrist, Jul 03 2022
Showing 1-8 of 8 results.