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

A104275 Numbers k such that 2k-1 is not prime.

Original entry on oeis.org

1, 5, 8, 11, 13, 14, 17, 18, 20, 23, 25, 26, 28, 29, 32, 33, 35, 38, 39, 41, 43, 44, 46, 47, 48, 50, 53, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, 71, 72, 73, 74, 77, 78, 80, 81, 83, 85, 86, 88, 89, 92, 93, 94, 95, 98, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113
Offset: 1

Views

Author

Alexandre Wajnberg, Apr 17 2005

Keywords

Comments

Same as A053726 except for the first term of this sequence.
Numbers k such that A064216(k) is not prime. - Antti Karttunen, Apr 17 2015
Union of 1 and terms of the form (u+1)*(v+1) + u*v with 1 <= u <= v. - Ralf Steiner, Nov 17 2021

Examples

			a(1) = 1 because 2*1-1=1, not prime.
a(2) = 5 because 2*5-1=9, not prime (2, 3 and 4 give 3, 5 and 7 which are primes).
From _Vincenzo Librandi_, Jan 15 2013: (Start)
As a triangular array (apart from term 1):
   5;
   8,  13;
  11,  18,  25;
  14,  23,  32,  41;
  17,  28,  39,  50,  61;
  20,  33,  46,  59,  72,  85;
  23,  38,  53,  68,  83,  98, 113;
  26,  43,  60,  77,  94, 111, 128, 145;
  29,  48,  67,  86, 105, 124, 143, 162, 181;
  32,  53,  74,  95, 116, 137, 158, 179, 200, 221; etc.
which is obtained by (2*h*k + k + h + 1) with h >= k >= 1. (End)
The above array, which contains the same terms as A053726 but in different order and with some duplicates, has its own entry A144650. - _Antti Karttunen_, Apr 17 2015
		

Crossrefs

Cf. A006254 (complement), A246371 (a subsequence).

Programs

  • Magma
    [n: n in [1..220]| not IsPrime(2*n-1)]; // Vincenzo Librandi, Jan 28 2011
    
  • Maple
    remove(t -> isprime(2*t-1), [$1..1000]); # Robert Israel, Apr 17 2015
  • Mathematica
    Select[Range[115], !PrimeQ[2#-1] &] (* Robert G. Wilson v, Apr 18 2005 *)
  • PARI
    select( {is_A104275(n)=!isprime(n*2-1)}, [1..115]) \\ M. F. Hasler, Aug 02 2022
    
  • Python
    from sympy import isprime
    def ok(n): return not isprime(2*n-1)
    print(list(filter(ok, range(1, 114)))) # Michael S. Branicky, May 08 2021
    
  • Python
    from sympy import primepi
    def A104275(n):
        if n <= 2: return ((n-1)<<2)+1
        m, k = n-1, (r:=primepi(n-1)) + n - 1 + (n-1>>1)
        while m != k:
            m, k = k, (r:=primepi(k)) + n - 1 + (k>>1)
        return r+n-1 # Chai Wah Wu, Aug 02 2024
    
  • SageMath
    [n for n in (1..250) if not is_prime(2*n-1)] # G. C. Greubel, Oct 17 2023
  • Scheme
    (define (A104275 n) (if (= 1 n) 1 (A053726 (- n 1)))) ;; More code in A053726. - Antti Karttunen, Apr 17 2015
    

Formula

a(n) = A047845(n-1) + 1.
For n > 1, a(n) = A053726(n-1) = n + A008508(n-1). - Antti Karttunen, Apr 17 2015
a(n) = (A014076(n)+1)/2. - Robert Israel, Apr 17 2015

Extensions

More terms from Robert G. Wilson v, Apr 18 2005

A053726 "Flag numbers": number of dots that can be arranged in successive rows of K, K-1, K, K-1, K, ..., K-1, K (assuming there is a total of L > 1 rows of size K > 1).

Original entry on oeis.org

5, 8, 11, 13, 14, 17, 18, 20, 23, 25, 26, 28, 29, 32, 33, 35, 38, 39, 41, 43, 44, 46, 47, 48, 50, 53, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, 71, 72, 73, 74, 77, 78, 80, 81, 83, 85, 86, 88, 89, 92, 93, 94, 95, 98, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 116
Offset: 1

Views

Author

Dan Asimov, asimovd(AT)aol.com, Apr 09 2003

Keywords

Comments

Numbers of the form F(K, L) = KL+(K-1)(L-1), K, L > 1, i.e. 2KL - (K+L) + 1, sorted and duplicates removed.
If K=1, L=1 were allowed, this would contain all positive integers.
Positive numbers > 1 but not of the form (odd primes plus one)/2. - Douglas Winston (douglas.winston(AT)srupc.com), Sep 11 2003
In other words, numbers n such that 2n-1, or equally, A064216(n) is a composite number. - Antti Karttunen, Apr 17 2015
Note: the following comment was originally applied in error to the numerically similar A246371. - Allan C. Wechsler, Aug 01 2022
From Matthijs Coster, Dec 22 2014: (Start)
Also area of (over 45 degree) rotated rectangles with sides > 1. The area of such rectangles is 2ab - a - b + 1 = 1/2((2a-1)(2b-1)+1).
Example: Here a = 3 and b = 5. The area = 23.
*
***
*****
*****
*****
***
*
(End)
The smallest integer > k/2 and coprime to k, where k is the n-th odd composite number. - Mike Jones, Jul 22 2024
Numbers k such that A193773(k-1) > 1. - Allan C. Wechsler, Oct 22 2024

Crossrefs

Essentially same as A104275, but without the initial one.
A144650 sorted into ascending order, with duplicates removes.
Cf. A006254 (complement, apart from 1, which is in neither sequence).
Differs from its subsequence A246371 for the first time at a(8) = 20, which is missing from A246371.

Programs

  • PARI
    select( {is_A053726(n)=n>4 && !isprime(n*2-1)}, [1..115]) \\ M. F. Hasler, Aug 02 2022
  • Python
    from sympy import isprime
    def ok(n): return n > 1 and not isprime(2*n-1)
    print(list(filter(ok, range(1, 117)))) # Michael S. Branicky, May 08 2021
    
  • Python
    from sympy import primepi
    def A053726(n):
        if n == 1: return 5
        m, k = n, (r:=primepi(n)) + n + (n>>1)
        while m != k:
            m, k = k, (r:=primepi(k)) + n + (k>>1)
        return r+n # Chai Wah Wu, Aug 02 2024
    
  • Scheme
    ;; with Antti Karttunen's IntSeq-library.
    (define A053726 (MATCHING-POS 1 1 (lambda (n) (and (> n 1) (not (prime? (+ n n -1)))))))
    ;; Antti Karttunen, Apr 17 2015
    
  • Scheme
    ;; with Antti Karttunen's IntSeq-library.
    (define (A053726 n) (+ n (A000720 (A071904 n))))
    ;; Antti Karttunen, Apr 17 2015
    

Formula

a(n) = A008508(n) + n + 1.
From Antti Karttunen, Apr 17 2015: (Start)
a(n) = n + A000720(A071904(n)). [The above formula reduces to this. A000720(k) gives number of primes <= k, and A071904 gives the n-th odd composite number.]
a(n) = A104275(n+1). (End)
a(n) = A116922(A071904(n)). - Mike Jones, Jul 22 2024
a(n) = A047845(n+1)+1. - Amiram Eldar, Jul 30 2024

Extensions

More terms from Douglas Winston (douglas.winston(AT)srupc.com), Sep 11 2003

A155151 Triangle T(n, k) = 4*n*k + 2*n + 2*k + 2, read by rows.

Original entry on oeis.org

10, 16, 26, 22, 36, 50, 28, 46, 64, 82, 34, 56, 78, 100, 122, 40, 66, 92, 118, 144, 170, 46, 76, 106, 136, 166, 196, 226, 52, 86, 120, 154, 188, 222, 256, 290, 58, 96, 134, 172, 210, 248, 286, 324, 362, 64, 106, 148, 190, 232, 274, 316, 358, 400, 442, 70, 116, 162
Offset: 1

Views

Author

Vincenzo Librandi, Jan 21 2009

Keywords

Comments

First column: A016957, second column: A017341, third column: 2*A017029, fourth column: A082286. - Vincenzo Librandi, Nov 21 2012
Conjecture: Let p = prime number. If 2^p belongs to the sequence, then 2^p-1 is not a Mersenne prime. - Vincenzo Librandi, Dec 12 2012
Conjecture is true because if T(n, k) = 2^p with p prime, then 2^p-1 = 4*n*k + 2*n + 2*k + 1 = (2*n+1)*(2*k+1) hence 2^p-1 is not prime. - Michel Marcus, May 31 2015
It appears that T(m,p) = 2^p for Lucasian primes (A002515) greater than 3. For instance: T(44, 11) = 2^11, T(89240, 23) = 2^23. - Michel Marcus, May 28 2015
For n > 1, ascending numbers along the diagonal are also terms of the even principal diagonal of a 2n X 2n spiral (A137928). - Avi Friedlich, May 21 2015

Examples

			Triangle begins
  10;
  16,  26;
  22,  36,  50;
  28,  46,  64,  82;
  34,  56,  78, 100, 122;
  40,  66,  92, 118, 144, 170;
  46,  76, 106, 136, 166, 196, 226;
  52,  86, 120, 154, 188, 222, 256, 290;
  58,  96, 134, 172, 210, 248, 286, 324, 362;
  64, 106, 148, 190, 232, 274, 316, 358, 400, 442;
		

Crossrefs

Programs

  • Magma
    [4*n*k + 2*n + 2*k + 2: k in [1..n], n in [1..11]]; // Vincenzo Librandi, Nov 21 2012
    
  • Maple
    seq(seq( 2*(2*n*k+n+k+1), k=1..n), n=1..15) # G. C. Greubel, Mar 21 2021
  • Mathematica
    T[n_,k_]:=4*n*k + 2*n + 2*k + 2; Table[T[n, k], {n, 11}, {k, n}]//Flatten (* Vincenzo Librandi, Nov 21 2012 *)
  • Sage
    flatten([[2*(2*n*k+n+k+1) for k in (1..n)] for n in (1..15)]) # G. C. Greubel, Mar 21 2021

Formula

T(n, k) = 2*A144650(n, k).
Sum_{k=1..n} T(n,k) = n*(2*n^2 + 5*n + 3) = n*A014105(n+2) =

Extensions

Edited by Robert Hochberg, Jun 21 2010

A244418 Triangle read by rows T(n,m) = n*m +(n-1)*(m-1), for n >= m >= 1.

Original entry on oeis.org

1, 2, 5, 3, 8, 13, 4, 11, 18, 25, 5, 14, 23, 32, 41, 6, 17, 28, 39, 50, 61, 7, 20, 33, 46, 59, 72, 85, 8, 23, 38, 53, 68, 83, 98, 113, 9, 26, 43, 60, 77, 94, 111, 128, 145, 10, 29, 48, 67, 86, 105, 124, 143, 162, 181, 11, 32, 53, 74, 95, 116, 137, 158, 179, 200, 221
Offset: 1

Views

Author

Wolfdieter Lang, Jul 10 2014

Keywords

Comments

This table is motivated by an entry of Aki Halme (A243907); see also A053726. a(n,m) is the number of stars on an array similar to the one appearing on the flag of the United States with n columns of m stars interchanged with (n-1) columns of (m-1) stars, for n>=2 and m = 2, ..., n.
The column sequences of the rectangular array R(n,m) = n*m + (n-1)*(m-1) = (2*n-1)*(m-1) + n for n >= 1 and m >= 1 (just symmetrize the given triangular array) are congruent n (mod (2*n-1)), n >= 1. With the odd modulus M = 2*n-1 and for M = d*L, that is d|n and L = (2*n-1)/d one can derive an identity for R(n,m) = d*(L*(m-1) + x) + (n - x*d) = d*k + (d+1)/2 (new modulus d) with k = L*(m-1) + x and n - x*d = (d+1)/2, that is x = ((2*n-1) - d)/(2*d) = (L-1)/2 which is a positive integer because L is odd. Then k = (2*L*m - (L+1))/2, also an integer. Thus for each divisor d of n the identity R(n, m) = R((d+1)/2, k+1) = R((d+1)/2, ((2*m-1)*(2*n-1)/d + 1)/2) holds.
The preceding identity shows that for odd composite moduli M = 2*n - 1 (with nontrivial divisors d of M) the sequence R(n,m), m >= 1 is a subsequence of the one for each modulus d. For example, for M = 15 = 3*5, n = 8, 15*(m-1) + 8 = 3*(5*m-3) + 2 = 5*(3*m-2) + 3 for m >= 1.

Examples

			The triangle T(n,m) begins:
n\m   1  2  3   4   5   6   7   8   9  10 ...
1:    1
2:    2  5
3:    3  8 13
4:    4 11 18  25
5:    5 14 23  32  41
6:    6 17 28  39  50  61
7:    7 20 33  46  59  72  85
8:    8 23 38  53  68  83  98 113
9:    9 26 43  60  77  94 111 128 145
10:  10 29 48  67  86 105 124 143 162 181 ...
For more rows see the link.
		

Crossrefs

Cf. A243907, A144650, A053726, A081436 (row sums).

Programs

  • PARI
    tabl(nn) = {for (n=1, nn, for (m=1, n, print1(n*m + (n-1)*(m-1), ", ");); print(););} \\ Michel Marcus, Jan 11 2015

Formula

T(n,m) = n*m + (n-1)*(m-1) = (2*n-1)*(m-1) + n, for n>=m, else 0.
G.f. for column m: G(m, x) = x^m*((2*m^2 - 2*m + 1) - 2*(m - 1)^2*x)/(1 - x)^2.
G.f. for triangle: sum(n >= 1, sum(m = 1..n, T(n,m)*x^m*y^n ) ) = (x*y+1)*(2*x*y^2-x*y-1)*x*y/((-1+y)^2*(x*y-1)^3). - Robert Israel, Jan 11 2015

A243907 Numbers that can be expressed as n*m + (n-1)*(m-1), n = 2, 3, ... , m = n, n+1, n+2, ... in at least two different ways. Ordered increasingly.

Original entry on oeis.org

23, 32, 38, 41, 50, 53, 59, 68, 74, 77, 83, 86, 88, 95, 98, 104, 113, 116, 122, 123, 128, 131, 137, 138, 140, 143, 149, 158, 163, 167, 173, 176, 179, 182, 185, 188, 193, 194, 200, 203, 212, 213, 215, 218, 221, 228, 230, 233, 238, 239, 242, 248, 254, 257, 263
Offset: 2

Views

Author

Aki Halme, Jun 14 2014

Keywords

Comments

This sequence was inspired by the flag of the United States. The 50 stars are placed in a rectangular grid with outside dimensions six stars wide by five stars high, but they could also be placed in a grid 17 stars wide by two stars high. This sequence lists, up to 200 stars, all numbers of stars that could be placed in a rectangular field in more than one arrangement.
This is the ordered list of integers that appear several times in A144650.
R(n,m) = n*m + (n-1)*(m-1) = (m-1)*(2*n-1) + n == n (mod (2*n-1)), and also with n interchanged with m. See A244418 for the table a(n,m) = R(n,m) for n >= m >= 1. - Wolfdieter Lang, Jul 10 2014

Examples

			23 = 8*2 + 7*1 = 5*3 +4*2.
32 = 11*2 + 10*1 = 5*4 + 4*3.
The first triple solution is 53 = 18*2 + 17*1 = 11*3 + 10*2 = 8*4 + 7*3.
		

Crossrefs

The sequence A186041 lists all possible solutions, including single ones, and has four additional terms at the start. The sequence A140646 also refers to the Stars-and-Stripes, but gives the history, not the geometry of the current arrangement.
Cf. also A144650, with all values organized by rows (but with different offset).

Programs

  • PARI
    lista(nn=200) = {v = []; vres = []; for (n=2, nn, for (m=2, n, new = n*m + (n-1)*(m-1); if (! vecsearch(v, new), v = vecsort(concat(v, n*m + (n-1)*(m-1))), if (! vecsearch(vres, new), vres = vecsort(concat(vres, new)));););); for (i=1, min(60, #vres), print1(vres[i], ", "));} \\ Michel Marcus, Jun 29 2014

Extensions

More terms from Michel Marcus, Jun 29 2014
Edited. Title reformulated. Crossrefs A053726 and A244418 added. - Wolfdieter Lang, Jul 10 2014
Showing 1-5 of 5 results.