[go: up one dir, main page]

login
Search: a003056 -id:a003056
     Sort: relevance | references | number | modified | created      Format: long | short | data
Multiplication table read by antidiagonals: T(i,j) = i*j, i>=1, j>=1.
+10
113
1, 2, 2, 3, 4, 3, 4, 6, 6, 4, 5, 8, 9, 8, 5, 6, 10, 12, 12, 10, 6, 7, 12, 15, 16, 15, 12, 7, 8, 14, 18, 20, 20, 18, 14, 8, 9, 16, 21, 24, 25, 24, 21, 16, 9, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 11, 20, 27, 32, 35, 36, 35, 32, 27, 20, 11, 12, 22, 30, 36, 40, 42, 42, 40, 36, 30, 22, 12
OFFSET
1,2
COMMENTS
Or, triangle X(n,m) = T(n-m+1,m) read by rows, in which row n gives the numbers n*1, (n-1)*2, (n-2)*3, ..., 2*(n-1), 1*n.
Radius of incircle of Pythagorean triangle with sides a=(n+1)^2-m^2, b=2*(n+1)*m and c=(n+1)^2+m^2. - Floor van Lamoen, Aug 16 2001
A permutation of A061017. - Matthew Vandermast, Feb 28 2003
In the proof of countability of rational numbers they are arranged in a square array. a(n) = p*q where p/q is the corresponding rational number as read from the array. - Amarnath Murthy, May 29 2003
Permanent of upper right n X n corner is A000442. - Marc LeBrun, Dec 11 2003
Row 12 gives total number of partridges, turtle doves, ... and drummers drumming that you have received at the end of the Twelve Days of Christmas song. - Alonso del Arte, Jun 17 2005
Consider a particle with spin S (a half-integer) and 2S+1 quantum states |m>, m = -S,-S+1,...,S-1,S. Then the matrix element <m+1|S_+|m> = sqrt((S+m+1)(S-m)) of the spin-raising operator is the square-root of the triangular (tabl) element T(r,o) of this sequence in row r = 2S, and at offset o=2(S+m). T(r,o) is also the intensity |<m+1|S_+|m><m|S_-|m+1>| of the transition between the states |m> and |m+1>. For example, the five transitions between the 6 states of a spin S=5/2 particle have relative intensities 5,8,9,8,5. The total intensity of all spin 5/2 transitions (relative to spin 1/2) is 35, which is the tetrahedral number A000292(5). - Stanislav Sykora, May 26 2012
Sum_{k=0..2n-2} (-1)^k*a(A000124(2n-2)+k) = n. See A098359. - Charlie Marion, Apr 22 2013
T(n, k) is also the (k-1)-superdiagonal sum of an n X n Toeplitz matrix M(n) whose first row consists of successive positive integer numbers 1, ..., n. - Stefano Spezia, Jul 12 2019
From Eric Lengyel, Jun 28 2023: (Start)
X(n, m+1) is the number of degrees of freedom that an m-dimensional flat geometry (point, line, plane, etc.) has when embedded in an n-dimensional Euclidean space.
X(n+1, m+1) is the number of degrees of freedom that an m-ball has when embedded in an n-dimensional Euclidean space. (End)
REFERENCES
J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 46.
LINKS
Iva Kodrnja and Helena Koncul, Number of Polynomials Vanishing on a Basis of S_m(Gamma_0(N)), arXiv:2405.10747 [math.NT], 2024. See p. 10.
G. W. Leibniz, Dissertatio de arte combinatoria, 1666, Leipzig. (in Latin. This triangle appears on p. 208, page 44 of the PDF file).
Abdelkader Necer, Séries formelles et produit de Hadamard, Journal de théorie des nombres de Bordeaux, 9 no. 2 (1997), p. 319-335.
Boris Putievskiy, Transformations Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
N. J. A. Sloane, "A Handbook of Integer Sequences" Fifty Years Later, arXiv:2301.03149 [math.NT], 2023, p. 5.
FORMULA
Rectangular array: T(n, m) = n*m, n>=1, m>= 1.
Triangle X(n, m) = T(n-m+1, m) = (n-m+1)*m.
Sum_{i=1..n} Sum_{j=1..n} a(n) = A000537(n) [Sum of first n cubes; or n-th triangular number squared.] Determinant of all n X n contiguous subarrays of A003991 is 0. - Gerald McGarvey, Sep 26 2004
G.f. as rectangular array: x * y / [ (1-x)^2 * (1-y)^2 ].
a(n) = i*j, where i=floor((1+sqrt(8n-7))/2), j=n-i*(i-1)/2. - Hieronymus Fischer, Aug 08 2007
As an infinite lower triangular matrix equals A000012 * A002260; where A000012 = (1; 1,1; 1,1,1; ...) and A002260 = (1; 1,2; 1,2,3; ...). - Gary W. Adamson, Oct 23 2007
As a linear array, the sequence is a(n) = A002260(n)*A004736(n) or a(n) = ((t*t+3*t+4)/2-n)*(n-(t*(t+1)/2)), where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 17 2012
G.f. as linear array: (x - 3*x^2 + Sum_{k >= 0} ((k+2-x-(k+1)*x^2)*x^((k^2+3*k+4)/2)))/(1-x)^3. - Robert Israel, Dec 14 2015
E.g.f. as triangle: exp(x+y)*(1 + x - y + x*y - y^2). - Stefano Spezia, Jul 12 2019
a(n) = (1/2)*t + (n - 1/4)*t^2 - (1/4)*t^4 - n^2 + n, where t = floor(sqrt(2*n) + 1/2). - Ridouane Oudra, Nov 21 2020
a(n) = A003989(n) * A003990(n) = A059895(n) * A059896(n) = A059895(n)^2 * A059897(n). - Antti Karttunen, Dec 13 2021
T(n,k) = A002620(n+k) - A002620(n-k). - Michel Marcus, Jan 06 2023
T(n,k) = number of sums |x-y|+|y-z| = k, where x,y,z are in {1,2,...,n} and x < y < z. - Clark Kimberling, Jan 22 2024
EXAMPLE
The array T starts in row n=1 with columns m>=1 as:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
3 6 9 12 15 18 21 24 27 30 33 36 39 42 45
4 8 12 16 20 24 28 32 36 40 44 48 52 56 60
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
6 12 18 24 30 36 42 48 54 60 66 72 78 84 90
7 14 21 28 35 42 49 56 63 70 77 84 91 98 105
8 16 24 32 40 48 56 64 72 80 88 96 104 112 120
9 18 27 36 45 54 63 72 81 90 99 108 117 126 135
10 20 30 40 50 60 70 80 90 100 110 120 130 140 150
The triangle X(n, m) begins
n\m 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
1: 1
2: 2 2
3: 3 4 3
4: 4 6 6 4
5: 5 8 9 8 5
6: 6 10 12 12 10 6
7: 7 12 15 16 15 12 7
8: 8 14 18 20 20 18 14 8
9: 9 16 21 24 25 24 21 16 9
10: 10 18 24 28 30 30 28 24 18 10
11: 11 20 27 32 35 36 35 32 27 20 11
12: 12 22 30 36 40 42 42 40 36 30 22 12
13: 13 24 33 40 45 48 49 48 45 40 33 24 13
14: 14 26 36 44 50 54 56 56 54 50 44 36 26 14
15: 15 28 39 48 55 60 63 64 63 60 55 48 39 28 15
... Formatted by Wolfdieter Lang, Dec 02 2014
MAPLE
seq(seq(i*(n-i), i=1..n-1), n=2..10); # Robert Israel, Dec 14 2015
MATHEMATICA
Table[(x + 1 - y) y, {x, 13}, {y, x}] // Flatten (* Robert G. Wilson v, Oct 06 2007 *)
f[n_] := Table[SeriesCoefficient[E^(x + y) (1+ x - y +x*y-y^2), {x, 0, i}, {y, 0, j}]*i!*j!, {i, n, n}, {j, 0, n}]; Flatten[Array[f, 11, 0]] (* Stefano Spezia, Jul 12 2019 *)
PROG
(PARI) A003991(n, k) = if(k<1 || n<1, 0, k*n)
(Magma) /* As triangle */ [[k*(n-k+1): k in [1..n]]: n in [1..15]]; // Vincenzo Librandi, Jul 12 2019
CROSSREFS
Main diagonal gives squares A000290. Antidiagonal sums are tetrahedral numbers A000292. See A004247 for another version.
KEYWORD
tabl,nonn,nice,easy,look
AUTHOR
EXTENSIONS
More terms from Michael Somos
STATUS
approved
Numbers of the form 2^i - 2^j with i >= j.
+10
72
0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 96, 112, 120, 124, 126, 127, 128, 192, 224, 240, 248, 252, 254, 255, 256, 384, 448, 480, 496, 504, 508, 510, 511, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1023
OFFSET
1,3
COMMENTS
Numbers whose digits in base 2 are in nonincreasing order.
Might be called "nialpdromes".
Subset of A077436. Proof: Since a(n) is of the form (2^i-1)*2^j, i,j >= 0, a(n)^2 = (2^(2i) - 2^(i+1))*2^(2j) + 2^(2j) where the first sum term has i-1 one bits and its 2j-th bit is zero, while the second sum term switches the 2j-th bit to one, giving i one bits, as in a(n). - Ralf Stephan, Mar 08 2004
Numbers whose binary representation contains no "01". - Benoit Cloitre, May 23 2004
Every polynomial with coefficients equal to 1 for the leading terms and 0 after that, evaluated at 2. For instance a(13) = x^4 + x^3 + x^2 at 2, a(14) = x^4 + x^3 + x^2 + x at 2. - Ben Paul Thurston, Jan 11 2008
From Gary W. Adamson, Jul 18 2008: (Start)
As a triangle by rows starting:
1;
2, 3;
4, 6, 7;
8, 12, 14, 15;
16, 24, 28, 30, 31;
...,
equals A000012 * A130123 * A000012, where A130123 = (1, 0,2; 0,0,4; 0,0,0,8; ...). Row sums of this triangle = A000337 starting (1, 5, 17, 49, 129, ...). (End)
First differences are A057728 = 1; 1; 1; 1; 2,1; 1; 4,2,1; 1; 8,4,2,1; 1; ... i.e., decreasing powers of 2, separated by another "1". - M. F. Hasler, May 06 2009
Apart from first term, numbers that are powers of 2 or the sum of some consecutive powers of 2. - Omar E. Pol, Feb 14 2013
From Andres Cicuttin, Apr 29 2016: (Start)
Numbers that can be digitally generated with twisted ring (Johnson) counters. This is, the binary digits of a(n) correspond to those stored in a shift register where the input bit of the first bit storage element is the inverted output of the last storage element. After starting with all 0’s, each new state is obtained by rotating the stored bits but inverting at each state transition the last bit that goes to the first position (see link).
Examples: for a(n) represented by three bits
Binary
a(5)= 4 -> 100 last bit = 0
a(6)= 6 -> 110 first bit = 1 (inverted last bit of previous number)
a(7)= 7 -> 111
and for a(n) represented by four bits
Binary
a(8) = 8 -> 1000
a(9) = 12 -> 1100 last bit = 0
a(10)= 14 -> 1110 first bit = 1 (inverted last bit of previous number)
a(11)= 15 -> 1111
(End)
Powers of 2 represented in bases which are terms of this sequence must always contain at least one digit which is also a power of 2. This is because 2^i mod (2^i - 2^j) = 2^j, which means the last digit always cycles through powers of 2 (or if i=j+1 then the first digit is a power of 2 and the rest are trailing zeros). The only known non-member of this sequence with this property is 5. - Ely Golden, Sep 05 2017
Numbers k such that k = 2^(1 + A000523(k)) - 2^A007814(k). - Daniel Starodubtsev, Aug 05 2021
A002260(n) = v(a(n)/2^v(a(n))+1) and A002024(n) = A002260(n) + v(a(n)) where v is the dyadic valuation (i.e., A007814). - Lorenzo Sauras Altuzarra, Feb 01 2023
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 (first 5051 terms from T. D. Noe)
Andreas M. Hinz and Paul K. Stockmeyer, Precious Metal Sequences and Sierpinski-Type Graphs, J. Integer Seq., Vol 25 (2022), Article 22.4.8.
S. M. Shabab Hossain, Md. Mahmudur Rahman and M. Sohel Rahman, Solving a Generalized Version of the Exact Cover Problem with a Light-Based Device, Optical Supercomputing, Lecture Notes in Computer Science, 2011, Volume 6748/2011, 23-31, DOI: 10.1007/978-3-642-22494-2_4.
Eric Weisstein's World of Mathematics, Digit.
Wikipedia, Ring counter.
FORMULA
a(n) = 2^s(n) - 2^((s(n)^2 + s(n) - 2n)/2) where s(n) = ceiling((-1 + sqrt(1+8n))/2). - Sam Alexander, Jan 08 2005
a(n) = 2^k + a(n-k-1) for 1 < n and k = A003056(n-2). The rows of T(r, c) = 2^r-2^c for 0 <= c < r read from right to left produce this sequence: 1; 2, 3; 4, 6, 7; 8, 12, 14, 15; ... - Frank Ellermann, Dec 06 2001
For n > 0, a(n) mod 2 = A010054(n). - Benoit Cloitre, May 23 2004
A140130(a(n)) = 1 and for n > 1: A140129(a(n)) = A002262(n-2). - Reinhard Zumkeller, May 14 2008
a(n+1) = (2^(n - r(r-1)/2) - 1) 2^(r(r+1)/2 - n), where r=round(sqrt(2n)). - M. F. Hasler, May 06 2009
Start with A000225. If k is in the sequence, then so is 2k. - Ralf Stephan, Aug 16 2013
G.f.: (x^2/((2-x)*(1-x)))*(1 + Sum_{k>=0} x^((k^2+k)/2)*(1 + x*(2^k-1))). The sum is related to Jacobi theta functions. - Robert Israel, Feb 24 2015
A049502(a(n)) = 0. - Reinhard Zumkeller, Jun 17 2015
a(n) = a(n-1) + a(n-d)/a(d*(d+1)/2 + 2) if n > 1, d > 0, where d = A002262(n-2). - Yuchun Ji, May 11 2020
A277699(a(n)) = a(n)^2, A306441(a(n)) = a(n+1). - Antti Karttunen, Feb 15 2021 (the latter identity from A306441)
Sum_{n>=2} 1/a(n) = A211705. - Amiram Eldar, Feb 20 2022
EXAMPLE
a(22) = 64 = 32 + 32 = 2^5 + a(16) = 2^A003056(20) + a(22-5-1).
a(23) = 96 = 64 + 32 = 2^6 + a(16) = 2^A003056(21) + a(23-6-1).
a(24) = 112 = 64 + 48 = 2^6 + a(17) = 2^A003056(22) + a(24-6-1).
MAPLE
a:=proc(n) local n2, d: n2:=convert(n, base, 2): d:={seq(n2[j]-n2[j-1], j=2..nops(n2))}: if n=0 then 0 elif n=1 then 1 elif d={0, 1} or d={0} or d={1} then n else fi end: seq(a(n), n=0..2100); # Emeric Deutsch, Apr 22 2006
MATHEMATICA
Union[Flatten[Table[2^i - 2^j, {i, 0, 100}, {j, 0, i}]]] (* T. D. Noe, Mar 15 2011 *)
Select[Range[0, 2^10], NoneTrue[Differences@ IntegerDigits[#, 2], # > 0 &] &] (* Michael De Vlieger, Sep 05 2017 *)
PROG
(PARI) for(n=0, 2500, if(prod(k=1, length(binary(n))-1, component(binary(n), k)+1-component(binary(n), k+1))>0, print1(n, ", ")))
(PARI) A023758(n)= my(r=round(sqrt(2*n--))); (1<<(n-r*(r-1)/2)-1)<<(r*(r+1)/2-n)
/* or, to illustrate the "decreasing digit" property and analogy to A064222: */
A023758(n, show=0)={ my(a=0); while(n--, show & print1(a", "); a=vecsort(binary(a+1)); a*=vector(#a, j, 2^(j-1))~); a} \\ M. F. Hasler, May 06 2009
(PARI) is(n)=if(n<5, 1, n>>=valuation(n, 2); n++; n>>valuation(n, 2)==1) \\ Charles R Greathouse IV, Jan 04 2016
(PARI) list(lim)=my(v=List([0]), t); for(i=1, logint(lim\1+1, 2), t=2^i-1; while(t<=lim, listput(v, t); t*=2)); Set(v) \\ Charles R Greathouse IV, May 03 2016
(Haskell)
import Data.Set (singleton, deleteFindMin, insert)
a023758 n = a023758_list !! (n-1)
a023758_list = 0 : f (singleton 1) where
f s = x : f (if even x then insert z s' else insert z $ insert (z+1) s')
where z = 2*x; (x, s') = deleteFindMin s
-- Reinhard Zumkeller, Sep 24 2014, Dec 19 2012
(Python)
def a_next(a_n): return (a_n | (a_n >> 1)) + (a_n & 1)
a_n = 1; a = [0]
for i in range(55): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022
CROSSREFS
A000337(r) = sum of row T(r, c) with 0 <= c < r. See also A002024, A003056, A140129, A140130, A221975.
Cf. A007088, A130123, A101082 (complement), A340375 (characteristic function).
This is the base-2 version of A064222. First differences are A057728.
Subsequence of A077436, of A129523, of A277704, and of A333762.
Subsequences: A043569 (nonzero even terms, or equally, nonzero terms doubled), A175332, A272615, A335431, A000396 (its even terms only), A324200.
Positions of zeros in A049502, A265397, A277899, A284264.
Positions of ones in A283983, A283989.
Positions of nonzero terms in A341509 (apart from the initial zero).
Positions of squarefree terms in A260443.
Fixed points of A264977, A277711, A283165, A334666.
Distinct terms in A340632.
Cf. also A309758, A309759, A309761 (for analogous sequences).
KEYWORD
nonn,easy
EXTENSIONS
Definition changed by N. J. A. Sloane, Jan 05 2008
STATUS
approved
Number of middle divisors of n, i.e., divisors in the half-open interval [sqrt(n/2), sqrt(n*2)).
+10
72
1, 1, 0, 1, 0, 2, 0, 1, 1, 0, 0, 2, 0, 0, 2, 1, 0, 1, 0, 2, 0, 0, 0, 2, 1, 0, 0, 2, 0, 2, 0, 1, 0, 0, 2, 1, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 1, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 2, 1, 0, 2, 0, 0, 0, 2, 0, 3, 0, 0, 0, 0, 2, 0, 0, 2, 1, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 2, 0, 1, 2, 1, 0, 0, 0, 2, 0
OFFSET
1,6
COMMENTS
Comment from N. J. A. Sloane, Jan 03 2021: (Start)
Theorem 1: (i) a(n) = (number of odd divisors of n <= sqrt(2*n)) - (number of odd divisors of n > sqrt(2*n)).
(ii) Let r(n) = A003056(n). Then a(n) = (number of odd divisors of n <= r(n)) - (number of odd divisors of n > r(n)).
(iii) a(n) = Sum_{k=1..r(n)} (-1)^(k+1)*A237048(n,k).
(iv) a(n) is odd iff n is a square or twice a square (cf. A053866). Indices of odd terms give A028982. Indices of even terms give A028983.
The proofs are straightforward. These results were conjectured by Omar E. Pol in 2017. (End)
Theorem 2: a(n) is equal to the difference between the number of partitions of n into an odd number of consecutive parts and the number of partitions of n into an even number of consecutive parts. [Chapman et al., 2001; Hirschhorn and Hirschhorn, 2005]. - Omar E. Pol, Feb 06 2017
From Omar E. Pol, Feb 06 2017: (Start)
Conjecture 1: This is the central column of the isosceles triangle of A249351.
Conjecture 2: a(n) is also the width of the terrace at the n-th level in the main diagonal of the pyramid described in A245092.
Conjecture 3: a(n) is also the number of central subparts of the symmetric representation of sigma(n). For more information see A279387.
Conjectures 2 and 3 were proposed after Michel Marcus's conjecture in A237593. (End)
Conjectures 1, 2, and 3 are all true. - N. J. A. Sloane, Feb 11 2021
REFERENCES
Robin Chapman, Kimmo Eriksson and Richard Stanley, On the Number of Divisors of n in a Special Interval: Problem 10847, Amer. Math. Monthly 108:1 (Jan 2001), p. 77 (Proposal); 109:1 (Jan 2002), p. 80 (Solution). [Please do not delete this reference. - N. J. A. Sloane, Dec 16 2020]
LINKS
Robin Chapman, Kimmo Eriksson and Richard Stanley, On the Number of Divisors of n in a Special Interval: Problem 10847, Amer. Math. Monthly 108, (2001), p. 77; solution by Reiner Martin, Amer. Math. Monthly 109, (2002), p. 80.
M. D. Hirschhorn and P. M. Hirschhorn, Partitions into Consecutive Parts, Mathematics Magazine 78.5 (2005): 396-396.
Christian Kassel and Christophe Reutenauer, The zeta function of the Hilbert scheme of n points on a two-dimensional torus, arXiv:1505.07229v3 [math.AG], 2015, see page 29 Remarks 6.8(b). [Note that a later version of this paper has a different title and different contents, and the number-theoretical part of the paper was moved to the publication which is next in this list.]
Christian Kassel and Christophe Reutenauer, Complete determination of the zeta function of the Hilbert scheme of n points on a two-dimensional torus, arXiv:1610.07793 [math.NT], 2016, see Remark 1.3.
J. E. Vatne, The sequence of middle divisors is unbounded, arXiv:1607.02122 [math.NT], 2016, shows that there is a subsequence diverging to infinity.
FORMULA
G.f.: Sum_{k>=1} (-1)^(k-1)*x^(k*(k+1)/2)/(1-x^k). (This g.f. corresponds to the assertion in Theorem 2.)
Another g.f., corresponding to the definition: Sum_{k>=1} x^(2*k*(k+1))*(1-x^(6*k^2))/(1-x^(2*k)) + Sum_{k>=0} x^((k+1)*(2*k+1))*(1-x^((2*k+1)*(3*k+2))/(1-x^(2*k+1). - N. J. A. Sloane, Jan 04 2021
a(A128605(n)) = n and a(m) <> n for m < A128605(n). - Reinhard Zumkeller, Mar 14 2007
It appears that a(n) = A240542(n) - A240542(n-1), the difference between two adjacent Dyck paths as defined in A237593. - Hartmut F. W. Hoft, Feb 06 2017
The above conjecture is essentially the same as Michel Marcus's conjecture in A237593. - Omar E. Pol, Dec 20 2020
Conjecture: a(n) = A082647(n) - A131576(n) = A001227(n) - 2*A131576(n). - Omar E. Pol, Feb 06 2017
a(n) = A348406(n) - 1. - Omar E. Pol, Oct 29 2021
a(n) = A000005(n) - A067743(n). - Omar E. Pol, Jun 11 2022
EXAMPLE
a(6)=2 because the 2 middle divisors of 6 (2 and 3) are between sqrt(3) and sqrt(12).
MATHEMATICA
(* number of middle divisors *)
a067742[n_] := Select[Divisors[n], Sqrt[n/2] <= # < Sqrt[2n] &]
a067742[115] (* data *)
(* Hartmut F. W. Hoft, Jul 17 2014 *)
a[ n_] := If[ n < 1, 0, DivisorSum[ n, 1 &, n/2 <= #^2 < 2 n &]]; (* Michael Somos, Jun 04 2015 *)
(* support function a240542[] is defined in A240542 *)
b[n_] := a240542[n] - a240542[n-1]
Map[b, Range[105]] (* data - Hartmut F. W. Hoft, Feb 06 2017 *)
PROG
(PARI) A067742(n) = {sumdiv(n, d, d2 = d^2; n / 2 < d2 && d2 <= n << 1)} \\ M. F. Hasler, May 12 2008
(PARI) a(n) = A067742(n) = {my(d = divisors(n), iu = il = #d \ 2); if(#d <= 2, return(n < 3)); while(d[il]^2 > n>>1, il--); while(d[iu]^2 < (n<<1), iu++);
iu - il - 1 + issquare(n/2)} \\ David A. Corneth, Apr 06 2018
(Python)
from sympy import divisors
def A067742(n): return sum(1 for d in divisors(n, generator=True) if n <= 2*d**2 < 4*n) # Chai Wah Wu, Jun 09 2022
CROSSREFS
Cf. A001227, A003056, A028982, A028983, A053866, A067743, A071090 (sums of middle divisors), A082647, A128605, A131576.
Cf. also A071561 (positions of zeros), A071562 (positions of nonzeros), A299761 (middle divisors of n), A355143 (products of middle divisors).
Relation to Dyck paths: A237048, A237593, A240542 (partial sums), A245092, A249351, A279387, A348406.
KEYWORD
easy,nonn
AUTHOR
Marc LeBrun, Jan 29 2002
EXTENSIONS
Edited by N. J. A. Sloane, Jan 03 2021
STATUS
approved
Triangle read by rows in which row n lists two copies of the n-th row of triangle A237593.
+10
69
1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 3, 1, 1, 3, 3, 1, 1, 3, 3, 2, 2, 3, 3, 2, 2, 3, 4, 1, 1, 1, 1, 4, 4, 1, 1, 1, 1, 4, 4, 2, 1, 1, 2, 4, 4, 2, 1, 1, 2, 4, 5, 2, 1, 1, 2, 5, 5, 2, 1, 1, 2, 5, 5, 2, 2, 2, 2, 5, 5, 2, 2, 2, 2, 5, 6, 2, 1, 1, 1, 1, 2, 6, 6, 2, 1, 1, 1, 1, 2, 6, 6, 3, 1, 1, 1, 1, 3, 6, 6, 3, 1, 1, 1, 1, 3, 6
OFFSET
1,5
COMMENTS
For the construction of this sequence also we can start from A235791.
This sequence can be interpreted as an infinite Dyck path: UDUDUUDD...
Also we use this sequence for the construction of a spiral in which the arms in the quadrants give the symmetric representation of sigma, see example.
We can find the spiral (mentioned above) on the terraces of the stepped pyramid described in A244050. - Omar E. Pol, Dec 07 2016
The spiral has the property that the sum of the parts in the quadrants 1 and 3, divided by the sum of the parts in the quadrants 2 and 4, converges to 3/5. - Omar E. Pol, Jun 10 2019
LINKS
Robert Price, Table of n, a(n) for n = 1..30016 (rows n = 1..412, flattened)
EXAMPLE
Triangle begins (first 15.5 rows):
1, 1, 1, 1;
2, 2, 2, 2;
2, 1, 1, 2, 2, 1, 1, 2;
3, 1, 1, 3, 3, 1, 1, 3;
3, 2, 2, 3, 3, 2, 2, 3;
4, 1, 1, 1, 1, 4, 4, 1, 1, 1, 1, 4;
4, 2, 1, 1, 2, 4, 4, 2, 1, 1, 2, 4;
5, 2, 1, 1, 2, 5, 5, 2, 1, 1, 2, 5;
5, 2, 2, 2, 2, 5, 5, 2, 2, 2, 2, 5;
6, 2, 1, 1, 1, 1, 2, 6, 6, 2, 1, 1, 1, 1, 2, 6;
6, 3, 1, 1, 1, 1, 3, 6, 6, 3, 1, 1, 1, 1, 3, 6;
7, 2, 2, 1, 1, 2, 2, 7, 7, 2, 2, 1, 1, 2, 2, 7;
7, 3, 2, 1, 1, 2, 3, 7, 7, 3, 2, 1, 1, 2, 3, 7;
8, 3, 1, 2, 2, 1, 3, 8, 8, 3, 1, 2, 2, 1, 3, 8;
8, 3, 2, 1, 1, 1, 1, 2, 3, 8, 8, 3, 2, 1, 1, 1, 1, 2, 3, 8;
9, 3, 2, 1, 1, 1, 1, 2, 3, 9, ...
.
Illustration of initial terms as an infinite Dyck path (row n = 1..4):
.
. /\/\ /\/\
. /\ /\ /\/\ /\/\ / \ / \
. /\/\/ \/ \/ \/ \/ \/ \
.
.
Illustration of initial terms for the construction of a spiral related to sigma:
.
. row 1 row 2 row 3 row 4
. _ _ _
. |_
. _ _ |
. _ _ | |
. | | | |
. | | | |
. |_ _ |_ _| |
. |_ _ _ _| _|
. _ _ _|
.
.[1,1,1,1] [2,2,2,2] [2,1,1,2,2,1,1,2] [3,1,1,3,3,1,1,3]
.
The first 2*A003056(n) terms of the n-th row are represented in the A010883(n-1) quadrant and the last 2*A003056(n) terms of the n-th row are represented in the A010883(n) quadrant.
.
Illustration of the spiral constructed with the first 15.5 rows of triangle:
.
. 12 _ _ _ _ _ _ _ _
. | _ _ _ _ _ _ _|_ _ _ _ _ _ _ 7
. | | |_ _ _ _ _ _ _|
. _| | |
. |_ _|9 _ _ _ _ _ _ |_ _
. 12 _ _| | _ _ _ _ _|_ _ _ _ _ 5 |_
. _ _ _| | _| | |_ _ _ _ _| |
. | _ _ _| 9 _|_ _| |_ _ 3 |_ _ _ 7
. | | _ _| | 12 _ _ _ _ |_ | | |
. | | | _ _| _| _ _ _|_ _ _ 3 |_|_ _ 5 | |
. | | | | _| | |_ _ _| | | | |
. | | | | | _ _| |_ _ 3 | | | |
. | | | | | | 3 _ _ | | | | | |
. | | | | | | | _|_ 1 | | | | | |
. _|_| _|_| _|_| _|_| |_| _|_| _|_| _|_| _
. | | | | | | | | | | | | | | | |
. | | | | | | |_|_ _ _| | | | | | | |
. | | | | | | 2 |_ _|_ _| _| | | | | | |
. | | | | |_|_ 2 |_ _ _| _ _| | | | | |
. | | | | 4 |_ 7 _| _ _| | | | |
. | | |_|_ _ |_ _ _ _ | _| _ _ _| | | |
. | | 6 |_ |_ _ _ _|_ _ _ _| | _| _ _| | |
. |_|_ _ _ |_ 4 |_ _ _ _ _| _| | _ _ _| |
. 8 | |_ _ | 15| _| | _ _ _|
. |_ | |_ _ _ _ _ _ | _ _| _| |
. 8 |_ |_ |_ _ _ _ _ _|_ _ _ _ _ _| | _| _|
. |_ _| 6 |_ _ _ _ _ _ _| _ _| _|
. | 28| _ _|
. |_ _ _ _ _ _ _ _ | |
. |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _| |
. 8 |_ _ _ _ _ _ _ _ _|
. 31
.
The diagram contains A237590(16) = 27 parts.
The total area (also the total number of cells) in the n-th arm of the spiral is equal to sigma(n) = A000203(n), considering every quadrant and the axes x and y. (checked by hand up to row n = 128). The parts of the spiral are in A237270: 1, 3, 2, 2, 7...
Diagram extended by Omar E. Pol, Aug 23 2018
CROSSREFS
Row n has length 4*A003056(n).
The sum of row n is equal to 4*n = A008586(n).
Row n is a palindromic composition of 4*n = A008586(n).
Both column 1 and right border are A008619, n >= 1.
The connection between A196020 and A237270 is as follows: A196020 --> A236104 --> A235791 --> A237591 --> A237593 --> this sequence --> A237270.
KEYWORD
nonn,look,tabf
AUTHOR
Omar E. Pol, Mar 24 2014
STATUS
approved
Triangle read by rows: row n gives partial alternating sums of row n of A237048.
+10
69
1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 2, 2, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 2, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2
OFFSET
1,11
COMMENTS
All entries in the triangle are nonnegative since the number of 1's in odd-numbered columns of A237048 prior to column j, 1 <= j <= row(n), is at least as large as the number of 1's in even-numbered columns through column j. As a consequence:
(a) The two adjacent symmetric Dyck paths whose legs are defined by adjacent rows of triangle A237593 never cross each other (see also A235791 and A237591) and the rows in this triangle describe the widths between the legs.
(b) Let legs(n) denote the n-th row of triangle A237591, widths(n) the n-th row of this triangle, and c(n) the rightmost entry in the n-th row of this triangle (center of the Dyck path). Then area(n) = 2 * legs(n) . width(n) - c(n), where "." is the inner product, is the area between the two adjacent symmetric Dyck paths.
(c) For certain sequences of integers, it is known that area(n) = sigma(n); see A238443, A245685, A246955, A246956 and A247687.
Right border gives A067742. - Omar E. Pol, Jan 21 2017
For a proof that T(n, k) = | { d : d|n and k/2 < d <= k }, for 1 <= k <= row(n), an identity suggested by Peter Munn, see the link. A corollary to it is that the number of divisors of n in the half-open interval (row(n)/2, row(n)] equals the width of the symmetric representation of n at the diagonal: T(n, row(n)) = | { d : d|n and row(n)/2 < d <= row(n) } |. See also the comments and conjectures of Michel Marcus in A067742 and A237593. - Hartmut F. W. Hoft, Jun 24 2024
From Omar E. Pol, Jul 24 2024: (Start)
Conjecture 1: Every column is a periodic sequence.
Conjecture 2: The periods of the columns 1..8 are respectively: 1, 2, 6, 12, 60, 60, 420, 840.
Question 1: Is the period of the column k equal to A003418(k)? (End).
From Omar E. Pol, Jul 26 2024: (Start)
Column 1 gives A000012.
Column 2 gives A000035.
Conjecture 3: Column 3 gives [2, 0] together with A115357, hence column 3 gives 2 together with A171182.
Question 2: Except the first nine terms of A337976, is the column 4 the same as A337976?
Question 3: Except the first 14 terms of A366981, is the column 5 the same as A366981? (End)
From Hartmut F. W. Hoft, Aug 01 2024: (Start)
Conjectures 1 and 2 are true and the answer to question 1 is affirmative.
By definition, each column k in triangle T237048(n, k) of sequence A237048 is a periodic sequence of period k. Since the k-th term in row n of the triangle T(n, k) = Sum_{i=1 .. k) ( (-1)^(i+1) * T237048(n, i) ), with 1 <= k <= A003056(n), each initial subsequence T(n, 1) .. T(n, k) of row n in this triangle is periodic of period lcm(1, .. , k) = A003418(k). This implies that each column k in this sequence has period A003418(k).
Conjecture 3 and Question 2 are true. Since T237048(n, 1) = 1, T237208(n, 2) = 1 if n odd and 0 if n even, T237048(n, 3) = 1 if 3|n and 0 otherwise, and T237048(n, 4) = 1 if 4|(n-2) and 0 otherwise, equations T249223(n, 3) = 1 - (n mod 2) + delta( n mod 3) and T249223(n, 4) = 1 - (n mod 2) + delta( n mod 3) - delta( (n-2) mod 4) hold where delta(k) = 1 if k = 0 and 0 otherwise. With the 3rd column starting at n = A000217(3) = 6, each period starting in a row that is a multiple of 6 is [ 2 0 1 1 1 0 ], and appropriate shifts yield A115357 and A171182. With the 4th column starting at n = A000217(4) = 10, each period starting in a row n with 12|(n+2) is [ 0 0 2 0 0 1 1 0 1 0 1 1 ], and with a shift of 9 yields the apparently periodic A337976(10), A337976(11), ... (End)
FORMULA
T(n, k) = Sum_{j=1..k} (-1)^(j+1)*A237048(n, j), for n>=1 and 1 <= k <= floor((sqrt(8*n + 1) - 1)/2). - corrected by Hartmut F. W. Hoft, Jan 25 2018
EXAMPLE
Triangle begins:
---------------------------
n \ k 1 2 3 4 5 6
---------------------------
1 | 1;
2 | 1;
3 | 1, 0;
4 | 1, 1;
5 | 1, 0;
6 | 1, 1, 2;
7 | 1, 0, 0;
8 | 1, 1, 1;
9 | 1, 0, 1;
10 | 1, 1, 1, 0;
11 | 1, 0, 0, 0;
12 | 1, 1, 2, 2;
13 | 1, 0, 0, 0;
14 | 1, 1, 1, 0;
15 | 1, 0, 1, 1, 2;
16 | 1, 1, 1, 1, 1;
17 | 1, 0, 0, 0, 0;
18 | 1, 1, 2, 1, 1;
19 | 1, 0, 0, 0, 0;
20 | 1, 1, 1, 1, 2;
21 | 1, 0, 1, 1, 1, 0;
22 | 1, 1, 1, 0, 0, 0;
23 | 1, 0, 0, 0, 0, 0;
24 | 1, 1, 2, 2, 2, 2;
...
The triangle shows that area(n) has width 1 for powers of 2 and that area(p) for primes p consists of only 1 horizontal leg of width 1 (and its symmetric vertical leg in the mirror symmetric duplicate of this triangle).
MAPLE
r := proc(n) floor((sqrt(1+8*n)-1)/2) ; end proc: # R. J. Mathar 2015 A003056
A237048:=proc(n, k) local i; global r;
if n<(k-1)*k/2 or k>r(n) then return(0); fi;
if (k mod 2)=1 and (n mod k)=0 then return(1); fi;
if (k mod 2)=0 and ((n-k/2) mod k) = 0 then return(1); fi;
return(0);
end;
A249223:=proc(n, k) local i; global r, A237048;
if n<(k-1)*k/2 or k>r(n) then return(0); fi;
add( (-1)^(i+1)*A237048(n, i), i=1..k);
end;
for n from 1 to 12 do lprint([seq(A249223(n, k), k=1..r(n))]); od; # N. J. A. Sloane, Jan 15 2021
MATHEMATICA
cd[n_, k_] := If[Divisible[n, k], 1, 0]; row[n_] := Floor[(Sqrt[8 n + 1] - 1)/2]; a237048[n_, k_] := If[OddQ[k], cd[n, k], cd[n - k/2, k]];
a1[n_, k_] := Sum[(-1)^(j + 1)*a237048[n, j], {j, 1, k}];
a2[n_] := Drop[FoldList[Plus, 0, Map[(-1)^(# + 1) &, Range[row[n]]] a237048[n]], 1]; Flatten[Map[a2, Range[24]]] (* data *) (* Corrected by G. C. Greubel, Apr 16 2017 *)
PROG
(PARI) t237048(n, k) = if (k % 2, (n % k) == 0, ((n - k/2) % k) == 0);
kmax(n) = (sqrt(1+8*n)-1)/2;
t(n, k) = sum(j=1, k, (-1)^(j+1)*t237048(n, j));
tabf(nn) = {for (n=1, nn, for (k=1, kmax(n), print1(t(n, k), ", "); ); print(); ); } \\ Michel Marcus, Sep 20 2015
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Hartmut F. W. Hoft, Oct 23 2014
STATUS
approved
Triangle read by rows in which row n lists the widths of the symmetric representation of sigma(n).
+10
63
1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1
OFFSET
1,31
COMMENTS
Here T(n,k) is defined to be the "k-th width" of the symmetric representation of sigma(n), with n>=1 and 1<=k<=2n-1. Explanation: consider the diagram of the symmetric representation of sigma(n) described in A236104, A237593 and other related sequences. Imagine that the diagram for sigma(n) contains 2n-1 equidistant segments which are parallel to the main diagonal [(0,0),(n,n)] of the quadrant. The segments are located on the diagonal of the cells. The distance between two parallel segment is equal to sqrt(2)/2. T(n,k) is the length of the k-th segment divided by sqrt(2). Note that the triangle contains nonnegative terms because for some n the value of some widths is equal to zero. For an illustration of some widths see Hartmut F. W. Hoft's contribution in the Links section of A237270.
Row n has length 2*n-1.
Row sums give A000203.
If n is a power of 2 then all terms of row n are 1's.
If n is an even perfect number then all terms of row n are 1's except the middle term which is 2.
If n is an odd prime then row n lists (n+1)/2 1's, n-2 zeros, (n+1)/2 1's.
The number of blocks of positive terms in row n gives A237271(n).
The sum of the k-th block of positive terms in row n gives A237270(n,k).
It appears that the middle diagonal is also A067742 (which was conjectured by Michel Marcus in the entry A237593 and checked with two Mathematica functions up to n = 100000 by Hartmut F. W. Hoft).
It appears that the trapezoidal numbers (A165513) are also the numbers k > 1 with the property that some of the noncentral widths of the symmetric representation of sigma(k) are not equal to 1. - Omar E. Pol, Mar 04 2023
EXAMPLE
Triangle begins:
1;
1,1,1;
1,1,0,1,1;
1,1,1,1,1,1,1;
1,1,1,0,0,0,1,1,1;
1,1,1,1,1,2,1,1,1,1,1;
1,1,1,1,0,0,0,0,0,1,1,1,1;
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
1,1,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1;
1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1;
1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1;
1,1,1,1,1,1,1,1,1,2,2,2,2,2,1,1,1,1,1,1,1,1,1;
...
---------------------------------------------------------------------------
. Written as an isosceles triangle Diagram of
. the sequence begins: the symmetry of sigma
---------------------------------------------------------------------------
. _ _ _ _ _ _ _ _ _ _ _ _
. 1; |_| | | | | | | | | | | |
. 1,1,1; |_ _|_| | | | | | | | | |
. 1,1,0,1,1; |_ _| _|_| | | | | | | |
. 1,1,1,1,1,1,1; |_ _ _| _|_| | | | | |
. 1,1,1,0,0,0,1,1,1; |_ _ _| _| _ _|_| | | |
. 1,1,1,1,1,2,1,1,1,1,1; |_ _ _ _| _| | _ _|_| |
. 1,1,1,1,0,0,0,0,0,1,1,1,1; |_ _ _ _| |_ _|_| _ _|
. 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; |_ _ _ _ _| _| |
. 1,1,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1; |_ _ _ _ _| | _|
. 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1; |_ _ _ _ _ _| _ _|
. 1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1; |_ _ _ _ _ _| |
.1,1,1,1,1,1,1,1,1,2,2,2,2,2,1,1,1,1,1,1,1,1,1; |_ _ _ _ _ _ _|
...
From Omar E. Pol, Nov 22 2020: (Start)
Also consider the infinite double-staircases diagram defined in A335616.
For n = 15 the diagram with first 15 levels looks like this:
.
Level "Double-staircases" diagram
. _
1 _|1|_
2 _|1 _ 1|_
3 _|1 |1| 1|_
4 _|1 _| |_ 1|_
5 _|1 |1 _ 1| 1|_
6 _|1 _| |1| |_ 1|_
7 _|1 |1 | | 1| 1|_
8 _|1 _| _| |_ |_ 1|_
9 _|1 |1 |1 _ 1| 1| 1|_
10 _|1 _| | |1| | |_ 1|_
11 _|1 |1 _| | | |_ 1| 1|_
12 _|1 _| |1 | | 1| |_ 1|_
13 _|1 |1 | _| |_ | 1| 1|_
14 _|1 _| _| |1 _ 1| |_ |_ 1|_
15 |1 |1 |1 | |1| | 1| 1| 1|
.
Starting from A196020 and after the algorithm described in A280850 and A296508 applied to the above diagram we have a new diagram as shown below:
.
Level "Ziggurat" diagram
. _
6 |1|
7 _ | | _
8 _|1| _| |_ |1|_
9 _|1 | |1 1| | 1|_
10 _|1 | | | | 1|_
11 _|1 | _| |_ | 1|_
12 _|1 | |1 1| | 1|_
13 _|1 | | | | 1|_
14 _|1 | _| _ |_ | 1|_
15 |1 | |1 |1| 1| | 1|
.
The 15th row
of this seq: [1,1,1,1,1,1,1,1,0,0,0,1,1,1,2,1,1,1,0,0,0,1,1,1,1,1,1,1,1]
The 15th row
of A237270: [ 8, 8, 8 ]
The 15th row
of A296508: [ 8, 7, 1, 0, 8 ]
The 15th row
of A280851 [ 8, 7, 1, 8 ]
.
The number of horizontal steps (or 1's) in the successive columns of the above diagram gives the 15th row of this triangle.
For more information about the parts of the symmetric representation of sigma(n) see A237270. For more information about the subparts see A239387, A296508, A280851.
More generally, it appears there is the same correspondence between the original diagram of the symmetric representation of sigma(n) and the "Ziggurat" diagram of n. (End)
MATHEMATICA
(* function segments are defined in A237270 *)
a249351[n_] := Flatten[Map[segments, Range[n]]]
a249351[10] (* Hartmut F. W. Hoft, Jul 20 2022 *)
KEYWORD
nonn,tabf
AUTHOR
Omar E. Pol, Oct 26 2014
STATUS
approved
a(n) = 0 if n is of the form m*(m+3)/2, otherwise 1.
+10
59
0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1
OFFSET
0,1
COMMENTS
From Stark: "alpha = 0.101101110111101111101111110 ... is irrational. For if alpha were rational, its decimal expansion would be periodic and have a period of length r starting with the k-th digit of the expansion.
"But by the very nature of alpha, there will be blocks of r digits, all 1, in this expansion after the k-th digit and the periodicity would then guarantee that everything after such a block of r digits would also be all ones.
"This contradicts the fact that there will always be zeros occurring after any given point in the expansion of alpha. Hence alpha is irrational."
a(A000096(n)) = 0; a(A007401(n)) = 1. - Reinhard Zumkeller, Dec 04 2012
Sequence B is called a reverse reluctant sequence of sequence A, if B is triangle array read by rows: row number k lists first k elements of the sequence A in reverse order. A023532 is reverse reluctant sequence of sequence A211666. - Boris Putievskiy, Jan 11 2013
An example of a sequence with infinite critical exponent [Vaslet]. - N. J. A. Sloane, May 05 2013
REFERENCES
Harold M. Stark, An Introduction to Number Theory, The MIT Press, Cambridge, Mass, eighth printing 1994, page 170.
LINKS
Boris Putievskiy, Transformations Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
Elise Vaslet, Critical exponents of words over 3 letters, Electronic Journal of Combinatorics, 18 (2011), #P125.
FORMULA
a(n) = 0 if and only if 8n+9 is a square. - Charles R Greathouse IV, Jun 16 2011
Blocks of lengths 1, 2, 3, 4, ... of ones separated by a single zero.
a(n) = 1 - floor((sqrt(9+8n)-1)/2) + floor((sqrt(1+8n)-1)/2). - Paul Barry, May 25 2004
a(n) = A211666(m), where m = (t^2 + 3*t + 4)/2n - n, t = floor((-1 + sqrt(8*n-7))/2). - Boris Putievskiy, Jan 11 2013
a(n) = [A002262(n) < A003056(n)]. - Yuchun Ji, May 18 2020
EXAMPLE
From Boris Putievskiy, Jan 11 2013: (Start)
As a triangular array written by rows, the sequence begins:
0;
1, 0;
1, 1, 0;
1, 1, 1, 0;
1, 1, 1, 1, 0;
1, 1, 1, 1, 1, 0;
1, 1, 1, 1, 1, 1, 0;
...
(End)
MATHEMATICA
a = {}; Do[a = Append[a, Join[ {0}, Table[1, {n} ] ] ], {n, 1, 13} ]; a = Flatten[a]
Table[PadLeft[{0}, n, 1], {n, 0, 20}]//Flatten (* Harvey P. Dale, Jul 10 2019 *)
PROG
(PARI) for(n=1, 9, print1("0, "); for(i=1, n, print1("1, "))) \\ Charles R Greathouse IV, Jun 16 2011
(PARI) a(n)=!issquare(8*n+9) \\ Charles R Greathouse IV, Jun 16 2011
(Haskell)
a023532 = (1 -) . a010052 . (+ 9) . (* 8)
a023532_list = concat $ iterate (\rs -> 1 : rs) [0]
-- Reinhard Zumkeller, Dec 04 2012
(Python)
from sympy.ntheory.primetest import is_square
def A023532(n): return bool(is_square((n<<3)+9))^1 # Chai Wah Wu, Feb 10 2023
CROSSREFS
Essentially the same sequence as A114607 and A123110. - N. J. A. Sloane, Feb 07 2020
KEYWORD
nonn,easy
EXTENSIONS
Additional comments from Robert G. Wilson v, Nov 06 2000
STATUS
approved
Inventory sequence: record the number of zeros thus far in the sequence, then the number of ones thus far, then the number of twos thus far and so on, until a zero is recorded; the inventory then starts again, recording the number of zeros.
+10
59
0, 1, 1, 0, 2, 2, 2, 0, 3, 2, 4, 1, 1, 0, 4, 4, 4, 1, 4, 0, 5, 5, 4, 1, 6, 2, 1, 0, 6, 7, 5, 1, 6, 3, 3, 1, 0, 7, 9, 5, 3, 6, 4, 4, 2, 0, 8, 9, 6, 4, 9, 4, 5, 2, 1, 3, 0, 9, 10, 7, 5, 10, 6, 6, 3, 1, 4, 2, 0, 10, 11, 8, 6, 11, 6, 9, 3, 2, 5, 3, 2, 0, 11, 11, 10
OFFSET
1,5
COMMENTS
To get started we ask: how many zero terms are there? Since there are no terms in the sequence yet, we record a '0', and having recorded a '0', we begin again: How many zero terms are there? There is now one 0, so we record a '1' and continue. How many 1's are there? There's currently one '1' in the sequence, so we record a '1' and continue. How many 2's are there? There are no 2's yet, so we record a '0', and having recorded a 0, we begin again with the question "how many zero terms are there?" And so on.
a(46) = 0 because no 8's appear before it; but note a higher number, namely 9, has appeared. - Michael S. Branicky, Mar 16 2021
A similar situation occurs at n=124, where 14 has not yet appeared in the sequence, although 15 has appeared.
Reminiscent of Van Eck's sequence A181391. - N. J. A. Sloane, May 02 2021
From Jan Ritsema van Eck, May 02 2021: (Start)
The first 1000 terms seem to grow more or less in saw-tooth fashion with the largest terms (= the number of 0's), as well as the distance between the 0's, both approximately equal to the inverse triangular numbers A003056 (see attached graph #1).
But the picture changes when we go out to 10000 terms. Around the 1700th term, the 1's become more frequent than the 0's and the largest values are consistently somewhat larger than the inverse triangular numbers. Around the 2500th term the 2's become the most frequent number. Also after some 4000 terms, the largest values become much larger than the inverse triangular numbers. See graph #2. (End)
Comment on the colored plot of the first 1000467 terms, from Hans Havermann, May 02 2021: (Start)
If one is drawing a points-joined graph, it will obscure some of the inherent large-number dynamics. To get around that, this plot joins the points with a green line, superimposing the actual points in blue. This plot was created by Mathematica.
Your browser will likely compress the very large image to window size, so click on it to expand.
The points fall into linear features of the various counts of the various integers. The count for each integer changes as we move towards infinity and hence crosses over (changes place with) other counts unpredictably.
I decided to chart (see the blue text) the twenty largest counts at the rightmost spike which runs from the zero at 997010 to the zero at 1000467. These largest values are for the counts of integers 2 to 21 and appear at a(997013) for the 2-count; a(997014) for the 3-count, ..., and a(997032) for the 21-count.
The counts are 15275, 26832, 40162, 48539, 56364, 54372, 53393, 43588, 37288, 27396, 22425, 16735, 13099, 11460, 9466, 8386, 7191, 6478, 5777, and 5208, respectively. In my text they are sorted largest-to-smallest and written "count @ integer-being-counted": 56364 @ 6, 54372 @ 7, 53393 @ 8, 48539 @ 5, ... 5208 @ 21. (End)
A useful view may be gained by plotting the sequence against itself with an offset. Using the "Plot 2" link in the web page footer, enter "A342585" as sequences 1 and 2. Select "Plot Seq2(n+shift) vs Seq1(n)" and "Draw line segments". Start with "1" as the shift. The sequence appears somewhat like a fan, the first 4 or 5 sectors showing clearly, later sectors overlying each other. Larger shift values effectively compress early sectors into the vertical axis, making later sectors more visible. - Peter Munn, May 08 2021
For a version where a row ends not at the first zero, but rather at the last zero, see A347317. - N. J. A. Sloane, Sep 10 2021
For n around 2.5*10^9, the upper envelope of the sequence seems to be growing roughly like n/50, or maybe like O(n/log(n)). - N. J. A. Sloane, Feb 10 2023
LINKS
Brady Haran and N. J. A. Sloane, "A Number Sequence with Everything" (the Inventory Sequence A342585), Numberphile video, November 2022.
Hans Havermann, Colored plot of 1000467 terms [See Comments for a description of this plot]
Hugo Pfoertner, Listening to the first 100000 terms of A342585, YouTube video from "Talabfahrer".
Hugo Pfoertner, Hear 1 million terms of A342585, YouTube video from "Talabfahrer", alternative audio conversion.
N. J. A. Sloane, "A Handbook of Integer Sequences" Fifty Years Later, arXiv:2301.03149 [math.NT], 2023, p. 21.
EXAMPLE
As an irregular triangle this begins:
0;
1, 1, 0;
2, 2, 2, 0;
3, 2, 4, 1, 1, 0;
4, 4, 4, 1, 4, 0;
5, 5, 4, 1, 6, 2, 1, 0;
6, 7, 5, 1, 6, 3, 3, 1, 0;
7, 9, 5, 3, 6, 4, 4, 2, 0;
8, 9, 6, 4, 9, 4, 5, 2, 1, 3, 0;
9, 10, 7, 5, 10, 6, 6, 3, 1, 4, 2, 0;
10, 11, 8, 6, 11, 6, 9, 3, 2, 5, 3, 2, 0;
...
For row lengths see A347299. - N. J. A. Sloane, Aug 27 2021
From David James Sycamore, Oct 18 2021: (Start)
a(1) is 0 because the count is reset, and as yet there is no zero term immediately following another term. a(2) = 1 since the count is reset, a(1) = 0 and a(0) precedes it. The count now increments to terms equal to 1.
a(3) = 1 since a(2) = 1 and a(1) precedes it. a(4) = 0 because there is no term equal to 2 which is immediately preceded by another term.
a(5) = 2 since the count is reset, a(1) = a(4) = 0 and a(0), a(3) respectively, precede them. (End)
MAPLE
a:= proc(n) option remember; local t;
t:= `if`(a(n-1)=0, 0, b(n-1)+1);
b(n):=t; add(`if`(a(j)=t, 1, 0), j=1..n-1)
end: b(1), a(1):= 0$2:
seq(a(n), n=1..120); # Alois P. Heinz, Mar 16 2021
MATHEMATICA
a[n_] := a[n] = Module[{t}, t = If[a[n-1] == 0, 0, b[n-1]+1];
b[n] = t; Sum[If[a[j] == t, 1, 0], {j, 1, n-1}]];
b[1] = 0; a[1] = 0;
Array[a, 120] (* Jean-François Alcover, May 03 2021, after Alois P. Heinz *)
PROG
(Python)
def calc(required_value_number):
values_lst = []
current_count = 0
new_value = 0
for i in range(required_value_number):
new_value = values_lst.count(current_count)
values_lst.append(new_value)
if new_value == 0:
current_count = 0
else:
current_count += 1
return new_value # Written by Gilad Moyal
(Python)
from collections import Counter
def aupton(terms):
num, alst, inventory = 0, [0], Counter([0])
for n in range(2, terms+1):
c = inventory[num]
num = 0 if c == 0 else num + 1; alst.append(c); inventory.update([c])
return alst
print(aupton(84)) # Michael S. Branicky, Jun 12 2021
(PARI)
A342585_vec(N, c=[], i)=vector(N, j, while(#c<=i||#c<=c[i+1], c=concat(c, 0)); c[i+=1]+if(c[1+c[i]]++&&!c[i]||j==1, i=0)) \\ M. F. Hasler, Nov 13 2021
(PARI) \\ See Links section.
(AWK) # See Links section. - Luc Rousseau, May 02 2021
(MATLAB)
function [val, arr]=invSeq(N) % val = Nth term, arr = whole array up to N
k=0;
arr=zeros(1, N); % pre-allocate array
for i=1:N
an=sum((k==arr(2:i)));
arr(i)=an;
if an == 0
k = 0;
else
k=k+1;
end
end
val=arr(end);
end % Ben Cha, Nov 11 2022
(R)
# Prints the first 10, 068 terms
library("dplyr")
options(max.print=11000)
inventory <- data.frame(1, 0)
colnames(inventory) <- c("n", "an")
value_to_count = 0
n = 1
for(x in 1:128) # Increase the 128 for more terms. The number of terms
# given is on the order of x^1.9 in the region around 128.
{
status <- TRUE
while(status)
{
count <- length(which(inventory$an == value_to_count))
n = n + 1
inventory <- rbind(inventory, c(n, count))
status <- isTRUE(count != 0)
value_to_count = value_to_count + 1
}
value_to_count = 0
}
inventory # Damon Lay, Nov 10 2023
CROSSREFS
Records: A347305 and A348782.
Other inventory-type sequences: A030717, A174382, A333867, A358066, A357443, A356784.
A012257 (cf. also A011784) reverses the inventory process.
See A347062, A347738, A355916, A355917, A355918, A357317 for variants.
KEYWORD
nonn,look,easy,nice
AUTHOR
Joseph Rozhenko, Mar 16 2021
STATUS
approved
The midpoint of the (rotated) Dyck path from (0, n) to (n, 0) defined by A237593 has coordinates (a(n), a(n)). Also a(n) is the alternating sum of the n-th row of A235791.
+10
54
1, 2, 2, 3, 3, 5, 5, 6, 7, 7, 7, 9, 9, 9, 11, 12, 12, 13, 13, 15, 15, 15, 15, 17, 18, 18, 18, 20, 20, 22, 22, 23, 23, 23, 25, 26, 26, 26, 26, 28, 28, 30, 30, 30, 32, 32, 32, 34, 35, 36, 36, 36, 36, 38, 38, 40, 40, 40, 40, 42, 42, 42, 44, 45, 45, 47, 47, 47, 47, 49, 49, 52, 52
OFFSET
1,2
COMMENTS
The sequence is closely related to the alternating harmonic series.
Its asymptotic behavior is lim_{k -> infinity} a(k)/k = log 2. The relative error is abs(a(k) - k*log(2))/(k*log(2)) <= 2/sqrt(k).
Conjecture 1: the sequence of first positions of the alternating runs of odd and even numbers in a(k) equals A028982. Example: the positions in (1),(2),2,(3),3,5,5,(6),(7),7,7,9,9,9,11,(12),12,(13),13,15,... are 1,2,4,8,9,16,18,... Checked with a Mathematica function through a(1000000).
See A235791, A237591 and A237593 for additional formulas and properties.
Conjecture 2: The sequence of differences a(n) - a(n-1), for n>=1, appears to be equal to A067742(n), the sequence of middle divisors of n; as an empty sum, a(0) = 0, (which was conjectured by Michel Marcus in the entry A237593). Checked with the two respective Mathematica functions up to n=100000. - Hartmut F. W. Hoft, Jul 17 2014
The number of occurrences of n is A259179(n). - Omar E. Pol, Dec 11 2016
Conjecture 3: a(n) is also the difference between the total number of partitions of all positive integers <= n into an odd number of consecutive parts, and the total number of partitions of all positive integers <= n into an even number of consecutive parts. - Omar E. Pol, Apr 28 2017
Conjecture 4: a(n) is also the total number of central subparts of all symmetric representations of sigma of all positive integers <= n. - Omar E. Pol, Apr 29 2017
a(n) is also the sum of the odd-indexed terms of the n-th row of the triangle A237591. - Omar E. Pol, Jun 20 2018
a(n) is the total number of middle divisors of all positive integers <= n (after Michel Marcus's conjecture in A237593). - Omar E. Pol, Aug 18 2021
FORMULA
a(n) = Sum_{k = 1..A003056(n)} (-1)^(k+1) A235791(n,k).
a(n) = A285901(n) - A285902(n), assuming the conjecture 3. - Omar E. Pol, Feb 15 2018
a(n) = n - A322141(n). - Omar E. Pol, Dec 22 2020
EXAMPLE
From Omar E. Pol, Dec 22 2020: (Start)
Illustration of initial terms in two ways in accordance with the sum of the odd-indexed terms of the rows of A237591:
.
n a(n) _ _
1 1 _|_| |_|_
2 2 _|_ _| |_ _|
3 2 _|_ _| |_ _|_
4 3 _|_ _ _| |_ _ _|
5 3 _|_ _ _| _ |_ _ _|_ _
6 5 _|_ _ _ _| |_| |_ _ _ _|_|
7 5 _|_ _ _ _| |_| |_ _ _ _|_|_
8 6 _|_ _ _ _ _| _|_| |_ _ _ _ _|_|_
9 7 _|_ _ _ _ _| |_ _| |_ _ _ _ _|_ _|
10 7 _|_ _ _ _ _ _| |_| |_ _ _ _ _ _|_|
11 7 _|_ _ _ _ _ _| _|_| |_ _ _ _ _ _|_|_ _
12 9 _|_ _ _ _ _ _ _| |_ _| |_ _ _ _ _ _ _|_ _|
13 9 _|_ _ _ _ _ _ _| |_ _| |_ _ _ _ _ _ _|_ _|
14 9 _|_ _ _ _ _ _ _ _| _|_| _ |_ _ _ _ _ _ _ _|_|_ _
15 11 _|_ _ _ _ _ _ _ _| |_ _| |_| |_ _ _ _ _ _ _ _|_ _|_|_
16 12 |_ _ _ _ _ _ _ _ _| |_ _| |_| |_ _ _ _ _ _ _ _ _|_ _|_|
...
Figure 1. Figure 2.
.
Figure 1 shows the illustration of initial terms taken from the isosceles triangle of A237593. For n = 16 there are (9 + 2 + 1) = 12 cells in the 16th row of the diagram, so a(16) = 12.
Figure 2 shows the illustration of initial terms taken from an octant of the pyramid described in A244050 and A245092. For n = 16 there are (9 + 2 + 1) = 12 cells in the 16th row of the diagram, so a(16) = 12.
Note that if we fold each level (or row) of that isosceles triangle of A237593 we essentially obtain the structure of the pyramid described in A245092 whose terraces at the n-th level have a total area equal to sigma(n) = A000203(n).
(End).
MATHEMATICA
a[n_] := Sum[(-1)^(k + 1) Ceiling[(n + 1)/k - (k + 1)/2], {k, 1, Floor[-1/2 + 1/2 Sqrt[8 n + 1]]}]; Table[a[n], {n, 40}]
PROG
(PARI) a(n) = sum(k=1, floor(-1/2 + 1/2*sqrt(8*n + 1)), (-1)^(k + 1)*ceil((n + 1)/k - (k + 1)/2)); \\ Indranil Ghosh, Apr 21 2017
(Python)
from sympy import sqrt
import math
def a(n): return sum((-1)**(k + 1) * int(math.ceil((n + 1)/k - (k + 1)/2)) for k in range(1, int(math.floor(-1/2 + 1/2*sqrt(8*n + 1))) + 1))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Apr 21 2017
KEYWORD
nonn
AUTHOR
Hartmut F. W. Hoft, Apr 07 2014
EXTENSIONS
More terms from Omar E. Pol, Apr 16 2014
Definition edited by N. J. A. Sloane, Dec 20 2020
STATUS
approved
Irregular triangle read by rows where T(n,k) is the number of integer partitions of n with k modes.
+10
54
1, 0, 1, 0, 2, 0, 2, 1, 0, 4, 1, 0, 5, 2, 0, 7, 3, 1, 0, 11, 3, 1, 0, 16, 4, 2, 0, 21, 6, 3, 0, 29, 8, 4, 1, 0, 43, 7, 5, 1, 0, 54, 13, 8, 2, 0, 78, 12, 8, 3, 0, 102, 17, 11, 5, 0, 131, 26, 12, 6, 1, 0, 175, 29, 17, 9, 1, 0, 233, 33, 18, 11, 2, 0, 295, 47, 25
OFFSET
0,5
COMMENTS
A mode in a multiset is an element that appears at least as many times as each of the others. For example, the modes of {a,a,b,b,b,c,d,d,d} are {b,d}.
LINKS
FORMULA
Sum_{k=0..A003056(n)} k * T(n,k) = A372542. - Alois P. Heinz, May 05 2024
EXAMPLE
Triangle begins:
1
0 1
0 2
0 2 1
0 4 1
0 5 2
0 7 3 1
0 11 3 1
0 16 4 2
0 21 6 3
0 29 8 4 1
0 43 7 5 1
0 54 13 8 2
0 78 12 8 3
0 102 17 11 5
0 131 26 12 6 1
0 175 29 17 9 1
Row n = 8 counts the following partitions:
(8) (53) (431)
(44) (62) (521)
(332) (71)
(422) (3311)
(611)
(2222)
(3221)
(4211)
(5111)
(22211)
(32111)
(41111)
(221111)
(311111)
(2111111)
(11111111)
MATHEMATICA
msi[ms_]:=Select[Union[ms], Count[ms, #]>=Max@@Length/@Split[ms]&];
Table[Length[Select[IntegerPartitions[n], Length[msi[#]]==k&]], {n, 0, 15}, {k, 0, Floor[(Sqrt[1+8n]-1)/2]}]
CROSSREFS
Row sums are A000041.
Row lengths are A002024.
Removing columns 0 and 1 and taking sums gives A362607, ranks A362605.
Column k = 1 is A362608, ranks A356862.
This statistic (mode-count) is ranked by A362611.
For co-modes we have A362615, ranked by A362613.
A008284 counts partitions by length.
A096144 counts partitions by number of minima, A026794 by maxima.
A238342 counts compositions by number of minima, A238341 by maxima.
A275870 counts collapsible partitions.
KEYWORD
nonn,look,tabf
AUTHOR
Gus Wiseman, May 04 2023
STATUS
approved

Search completed in 0.198 seconds