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

A111774 Numbers that can be written as a sum of at least three consecutive positive integers.

Original entry on oeis.org

6, 9, 10, 12, 14, 15, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102
Offset: 1

Views

Author

Jaap Spies, Aug 15 2005

Keywords

Comments

In this sequence there are no (odd) primes and there are no powers of 2.
So we have only three kinds of natural numbers: the odd primes, the powers of 2 and the numbers that can be represented as a sum of at least three consecutive integers.
Odd primes can only be written as a sum of two consecutive integers. Powers of 2 do not have a representation as a sum of k consecutive integers (other than the trivial n=n, for k=1).
Numbers of the form (x*(x+1)-y*(y+1))/2 for nonnegative integers x,y with x-y >= 3. - Bob Selcoe, Feb 21 2014
Numbers of the form (x + 1)*(x + 2*y)/2 for integers x,y with x >= 2 and y >= 1. For y = 1 only triangular numbers (A000217) >= 6 occur. - Ralf Steiner, Jun 27 2019
From Ralf Steiner, Jul 09 2019: (Start)
If k >= 1 sequences are c_k(n) = c_k(n - 1) + n + k - 1, c_k(0) = 0, means c_k(n) = n*(n + 2*k - 1)/2: A000217, A000096, A055998, A055999, A056000, ... then this sequence is the union of c_k(n), n >= 3. (End)
From Wolfdieter Lang, Oct 28 2020: (Start)
This sequence gives all positive integers that have at least one odd prime as proper divisor. The proof follows from the first two comments.
The set {a(n)}_{n>=1} equals the set {k positive integer : floor(k/2) - delta(k) >= 1}, where delta(k) = A055034(k). Proof: floor(k/2) gives the number of positive odd numbers < k, and delta(k), gives the number of positive odd numbers coprime to k. delta(1) = 1 but 1 is not < 1, therefore k = 1 is not a member of this set. Hence a member >= 2 of this set has at least one odd number > 1 and < k missing in the set of odd numbers relative prime to k. Therefore there exists at least one odd prime < k dividing k. (End)
For the multiplicity of a(n) see A338428, obtained from triangle A337940 (the array is given Bob Selcoe as example below, and in the Ralf Steiner comment above). - Wolfdieter Lang, Dec 09 2020

Examples

			a(1)=6 because 6 is the first number that can be written as a sum of three consecutive positive integers: 6 = 1+2+3.
From _Bob Selcoe_, Feb 23 2014: (Start)
Let the top row of an array be A000217(n). Let the diagonals (reading down and left) be A000217(n)-A000217(1),  A000217(n)-A000217(2), A000217(n)-A000217(3)..., A000217(n)-A000217(n-3).  This is A049777 read as a square array, starting with the third column. The array begins as follows:
   6 10 15 21 28 36 45 55 66
   9 14 20 27 35 44 54 65
  12 18 25 33 42 52 63
  15 22 30 39 49 60
  18 26 35 45 56
  21 30 40 51
  24 34 45
  27 38
  30
This is (x*(x+1)-y*(y+1))/2 for nonnegative integers x,y with x-y >= 3, because it is equivalent to 1+2+3/+4/+5/...+x/-0/-1/-2/-3/-4/-5/...-(x+3)/ for all possible strings of consecutive integers, which represents every possible way to sum three or more consecutive positive integers. So for example, 4+5+6+7 = 1+2+3+4+5+6+7-1-2-3 = 22, which is (x*(x+1)-y*(y+1))/2 when x=7, y=3. Notice that values can appear more than once in the array because some numbers can be represented as sums of more than one string of three or more consecutive positive integers. For example, 30 = (x*(x+1)-y*(y+1))/2 when (a) x=11, y=8: 9+10+11; (b) x=9, y=5: 6+7+8+9; and (c) x=8, y=3: 4+5+6+7+8. By definition, x-y is the number of integers in the string. (End)
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, Solution to problem 3G p. 179.

Crossrefs

Programs

  • Maple
    ispoweroftwo := proc(n) local a, t; t := 1; while (n > t) do t := 2*t end do; if (n = t) then a := true else a := false end if; return a; end proc; f:= proc(n) if (not isprime(n)) and (not ispoweroftwo(n)) then return n end if; end proc; seq(f(i),i = 1..150);
  • Mathematica
    max=6!;lst={};Do[z=n+(n+1);Do[z+=(n+x);If[z>max,Break[]];AppendTo[lst,z],{x,2,max}],{n,max}];Union[lst] (* Vladimir Joseph Stephan Orlovsky, Mar 06 2010 *)
  • PARI
    isok(n) = !(n == 1) && !isprime(n) && !(isprimepower(n, &p) && (p == 2)); \\ Michel Marcus, Jul 02 2019
    
  • Python
    from sympy import primepi
    def A111774(n):
        def f(x): return int(n+(0 if x<=1 else primepi(x)-1)+x.bit_length())
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Sep 19 2024

A219839 a(n) is the number of odd integers in 2..(n-1) that have a common factor (other than 1) with n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 2, 0, 1, 3, 0, 0, 3, 0, 2, 4, 1, 0, 4, 2, 1, 4, 2, 0, 7, 0, 0, 6, 1, 5, 6, 0, 1, 7, 4, 0, 9, 0, 2, 10, 1, 0, 8, 3, 5, 9, 2, 0, 9, 7, 4, 10, 1, 0, 14, 0, 1, 13, 0, 8, 13, 0, 2, 12, 11, 0, 12, 0, 1, 17, 2, 8, 15, 0, 8, 13, 1, 0, 18
Offset: 1

Views

Author

Lei Zhou, Nov 29 2012

Keywords

Comments

a(n) is also the number of linearly dependent diagonal/side length ratios R(n,k), in the regular n-gon. The following will explain this. In the regular n-gon inscribed in a circle the number of distinct diagonals including the side is floor(n/2). Not all of the corresponding length ratios R(n,k) = d(n,k)/d(n,1), k = 1..floor(n/2), with d(n,1) = s(n) (the length of the side), d(n,2) the length of the smallest diagonal, etc., are linearly independent because C(n,R(n,2)) = 0, where C is the minimal polynomial of R(n,2) = 2*cos(Pi/n) (see A187360) with degree delta(n) = A055034(n). Thus every ratio R(n,j), with j = delta(n)+1, ..., floor(n/2) can be expressed as a linear combination of the independent R(n,k), k=1, ..., delta(n). See the comment from Sep 21 2013 on A053121 for powers of R(n,2) (called there rho(N)). Therefore, a(n) = floor(n/2) - delta(n) is, for n>=2, the number of linearly dependent ratios R(n,k) in the regular n-gon. - Wolfdieter Lang, Sep 23 2013
From Wolfdieter Lang, Nov 23 2020: (Start)
This sequence gives the difference between the number of odd numbers in the smallest nonnegative residue system modulo n (called here RS(n)) and the smallest nonnegative restricted residue system (called here RRS(n), but RRS(1) = {1}, not {0}).
This sequence can be used to find sequence A111774 by recording the positions of the entries >= 1. See a W. Lang comment there, and also A337940, for the proof. Hence the complement of A111774, given in A174090, is given by the numbers m with a(m) = 0. (End)

Examples

			n=1: there is no odd number greater than 2 but smaller than 1-1=0, so a(1)=0.
Same for n=2,3.
n=4: 3 is the only odd number in 2..(4-1), and GCD(3,4)=1, so a(4)=0.
For any prime numbers and numbers in the form of 2^n, no odd number in 2..(n-1) has common factor with n, so a(p)=0 and a(2^n)=0, n>0.
n=6: 3,5 are odd numbers in 2..(6-1), and GCD(3,6)=3>1 and GCD(5,6)=1, so a(6)=1.
n=15: candidates are 3,5,7,9,11,13.  3, 5, and 9 have greater than 1 common factors with 15, so a(15)=3
From _Wolfdieter Lang_, Sep 23 2013: (Start)
Example n = 15 for a(n) = floor(n/2) - delta(n): 1, 3, 5, 7, 9, 11, 13 take out 1, 7, 9, 11, leaving 3, 5, 13. Therefore, a(15) = 7 - 4 = 3. See the formula above for delta.
In the regular 15-gon the 3 (= a(15)) diagonal/side ratios R(15, 5), R(15, 6) and R(15,7) can be expressed as linear combinations of the R(15,j), j=1..4.  See the n-gon comment above. (End)
From _Wolfdieter Lang_, Nov 23 2020: (Start)
n = 1: RS(1) = {0}, RRS(1) = {1}, hence a(1) = 0 - 1 = 0. Here RRS(1) is not {0}(standard) because delta(1) := 1 (the degree of minimal polynomial for 2*cos(Pi//1) = -2 which is x+2, see A187360).
n = 6: RS(6) = {0, 1, 2, 3, 4, 5} and RRS(6) = {1,5}, hence a(6) = 3 - 2 = 1, and A111774(1) = 6 = A337940(1, 1).
a(15) = 7 - 4 = 3, and A111774(6) = 15 = A337940(3, 3) = A337940(4, 1) (multiplicity 2 = A338428(6)). (End)
		

Crossrefs

Cf. A000010, A016035 (see 1st comment there), A004526, A055034, A111774, A174090, A190357, A337940, A338428.

Programs

Formula

a(n) = floor(n/2) - delta(n), with floor(n/2) = A004526 and delta(n) = A055034(n) = phi(2*n)/2, for n >= 2, with Euler's phi A000010. See the Aug 17 2011 comment on A055034. For n = 1 this would be -1, not 0, because delta(1) = 1. - Wolfdieter Lang, Sep 23 2013
Sum_{k=1..n} a(k) ~ c*n^2, where c = 1/4 - 2/Pi^2 = 0.04735763... (A190357). - Amiram Eldar, Feb 23 2025

A337940 Triangle read by rows: T(n, k) = T(n+2) - T(n-k), with the triangular numbers T = A000217, for n >= 1, k = 1, 2, ..., n.

Original entry on oeis.org

6, 9, 10, 12, 14, 15, 15, 18, 20, 21, 18, 22, 25, 27, 28, 21, 26, 30, 33, 35, 36, 24, 30, 35, 39, 42, 44, 45, 27, 34, 40, 45, 49, 52, 54, 55, 30, 38, 45, 51, 56, 60, 63, 65, 66, 33, 42, 50, 57, 63, 68, 72, 75, 77, 78, 36, 46, 55, 63, 70, 76, 81, 85, 88, 90, 91
Offset: 1

Views

Author

Wolfdieter Lang, Nov 23 2020

Keywords

Comments

This number triangle results from the array A(n, m) = T(n+m+1) - T(n-1), with T = A000217, for n, m >= 1. For this array see the example by Bob Selcoe, in A111774 (but with rows continued). The present triangle is obtained by reading the array by upwards antidiagonals: T(n, k) = A(n+1-k, k). See also the Jul 09 2019 comment by Ralf Steiner with the formula c_k(n) (rows k >= 1, columns n >= 3), rewritten for A(n, m) = (m+2)*(2*n+m+1)/2, leading to T(n, k) = (k+2)*(2*n-k+3)/2.
Therefore this triangle is related to the problem of giving the numbers which are sums of at least three consecutive positive integers given as sequence A111774. It allows us to find the multiplicities for the numbers of A111774. They are given in A338428(n).
To obtain the multiplicity for number N (>= 6) from A111774 one has to consider only the triangle rows n = 1, 2, ..., floor((N-3)/3).
The row reversed triangle, considered by Bob Selcoe in A111774, is T(n, n-k+1) = T(n+2) - T(k-1), for n >= 1, and k=1, 2, ..., n.
This triangle contains no odd prime numbers and no exact powers 2^m, for m >= 0. This can be seen by considering the diagonal sequences D(d, k), for d >= 1, k >= 1 or the row sequences of the array A(n, m), for n >= 1 and m >= 1. The result is A(r+1, s-2) = s*(s + 2*r + 1)/2, for r >= 0 and s >= 3 (from the g.f. of the diagonals of T given below). This is also given in the Jul 09 2019 comment by Ralf Steiner in A111774. Therefore A(r+1, s-2) is a product of two numbers >= 2, hence not a prime. And in both cases (i) s/2 integer or (ii) (s + 2*r + 1)/2 integer not both numbers can be powers of 2 by simple parity arguments.
The previous comment means that each T(n, k) has at least one odd prime as a proper divisor.
A number N appears in this triangle, or in A111774, if and only if floor(N/2) - delta(N) >= 1, where delta(N) = A055034(N). For the sequence b(n) := floor(n/2) - delta(n), for n >= 2, see A219839(n), b(1) = -1. See a W. Lang comment in A111774 for the proof.

Examples

			The triangle T(n, k) begins:
n \ k  1  2  3  4  5   6   7   8   9  10  11  12  13  14  15 ...
1:     6
2:     9 10
3:    12 14 15
4:    15 18 20 21
5:    18 22 25 27 28
6:    21 26 30 33 35  36
7:    24 30 35 39 42  44  45
8:    27 34 40 45 49  52  54  55
9:    30 38 45 51 56  60  63  65  66
10:   33 42 50 57 63  68  72  75  77  78
11:   36 46 55 63 70  76  81  85  88  90  91
12:   39 50 60 69 77  84  90  95  99 102 104 105
13:   42 54 65 75 84  92  99 105 110 114 117 119 120
14:   45 58 70 81 91 100 108 115 121 126 130 133 135 136
15:   48 62 75 87 98 108 117 125 132 138 143 147 150 152 153
...
N = 15 appears precisely twice from the sums 4+5+6 = A(4, 1) = T(4, 1), and (1+2+3)+4+5 = A(1, 3) = T(3, 3), i.e., with a sum of 3 and 5 consecutive positive integers.
N = 42 appears three times from the sums 13+14+15 = A(13, 1) = T(13, 1), 9+10+11 +12 = A(9, 2) = T(10, 2), 3+4+5+6+7+8+9 = A(3, 5) = T(7, 5); i.e., 42 can be written as a sum of 3, 4 and 7 consecutive positive integers.
		

Crossrefs

Cf. A055034, A111774, A338428 (multiplicities), A219839.
For columns k = 1, 2, ..., 10 see A008585, A016825, A008587, A016945, A008589, A017113, A008591, A017329, A008593, A017593.
For diagonals d = 1, 2, ..., 10 see A000217, A000096, A055998, A055999, A056000, A056115, A056119 , A056121, A056126, A051942.

Programs

  • Mathematica
    Flatten[Table[((n+2)*(n+3)-(n-k)*(n-k+1))/2,{n,11},{k,n}]] (* Stefano Spezia, Nov 24 2020 *)

Formula

T(n, k) = ((n+2)*(n+3) - (n-k)*(n-k+1))/2, for n >= 1 and k = 1, 2, ..., n (see the name).
T(n, k) = (k+2)*(2*n-k+3)/2 (factorized).
G.f. columns k = 2*j+1, for j >= 0: Go(j, x) = x^(2*j+1)*(2*j+3)*(j+2 - (j+1)*x)/(1-x)^2,
G.f. columns k = 2*j, for j >= 1: Ge(j, x) = x^(2*j)*(j+1)*(2*j+3 - (2*j+1)*x)/(1-x)^2.
G.f. row polynomials: G(z,x) = z*x*(1 + z*x)^3*{3*(2-z) - (8-3*z)*(z*x) + (3-z)*(z*x)^2}/((1 - z)^2*(1 - (z*x)^2)^3).
G.f. diagonals d >= 1: GD(d, x) = ((d+1)*3 - (5*d+3)*x + (2*d+1)*x^2)/(1-x)^3.
G.f. of GD(d, x): GGD(z,x) = (6-8*x+3*x^2 - (3-3*x+x^2)*z)/((1-x)^3*(1-z)^2).
Showing 1-3 of 3 results.