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.

User: Vinay Vaishampayan

Vinay Vaishampayan's wiki page.

Vinay Vaishampayan has authored 17 sequences. Here are the ten most recent ones:

A171895 Number of distinct terms among the first n terms of A181391.

Original entry on oeis.org

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

Author

Vinay Vaishampayan and N. J. A. Sloane, Oct 19 2010

Keywords

Crossrefs

Partial sums of A171894. Essentially A171896 - 1. Cf. A181391.

A151925 Write n as a sum of positive squares a^2+b^2+c^2+... with gcd(a,b,...) = 1; a(n) = minimal number of squares needed.

Original entry on oeis.org

1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 2, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 2, 2, 3, 4, 3, 3, 4, 5, 3, 2, 3, 4, 2, 3, 4, 5, 2, 3, 3, 4, 3, 3, 4, 5, 2, 3, 3
Offset: 1

Author

N. J. A. Sloane and Vinay Vaishampayan, Aug 06 2009, Aug 07 2009

Keywords

Comments

Similar to A002828, but only now primitive representations are allowed.
Of course a(n) >= A002828(n).
From Lagrange's theorem, a(n) <= 5 (see also Estermann, Grosswald, Th. 3, p. 176).
Furthermore, it appears (and should be easy to prove) that:
a(n) = 1 iff n=1
a(n) = 2 iff n in A008784\{1}
a(n) = 3 iff n in A151926
a(n) = 4 iff n == 4 or 7 mod 8
a(n) = 5 iff n == 0 mod 8

Examples

			..... n .. a(n) ..<- Numbers when squared add to n ->
-----------------------------------------------------
......1......1......1
......2......2......1......1
......3......3......1......1......1
......4......4......1......1......1......1
......5......2......1......2
......6......3......1......1......2
......7......4......1......1......1......2
......8......5......1......1......1......1......2
......9......3......1......2......2
.....10......2......1......3
.....11......3......1......1......3
.....12......4......1......1......1......3
.....13......2......2......3
.....14......3......1......2......3
.....15......4......1......1......2......3
.....16......5......1......1......1......2......3
.....17......2......1......4
.....18......3......1......1......4
.....19......3......1......3......3
.....20......4......1......1......3......3
		

References

  • Estermann, T., On the representations of a number as a sum of squares, Acta Arith., 45 (1937), 93-125.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985.

A140395 Number of letters in the Hindi word for the number n.

Original entry on oeis.org

4, 2, 2, 3, 3, 4, 2, 3, 3, 2, 2, 5, 4, 4, 4, 5, 4, 4, 5, 5, 3, 5, 4, 4, 5, 5, 5, 6, 6, 5, 3, 5, 5, 6, 6, 6, 5, 6, 5, 7, 5, 7, 6, 8, 8, 8, 7, 8, 7, 5, 4, 6, 4, 6, 4, 4, 4, 6, 6, 4, 3, 4, 4, 5, 5, 5, 6, 4, 4, 6, 4, 6, 5, 6, 6, 6, 6, 6, 6, 5, 4, 6, 5, 6, 6, 5, 6
Offset: 0

Author

Vinay Vaishampayan, Jun 19 2008, Jun 20 2008

Keywords

Comments

From Sangeet Paul, May 29 2019: (Start)
What constitutes a distinct letter is determined by the following rules: all words are in Modern Standard Hindi written in the Devanagari script; a vowel, a vowel diacritic, a consonant, a consonant diacritic, or a nasal diacritic is one letter; a conjunct consonant is as many letters as the consonants conjuncted; a nuqta or a halant is not a letter; and a space between two words is not a letter.
Hindi has a unique word for every number from 0 to 99, and a unique place-value word for 100 and every power of 10 of the form 10^(2k+1) where k is a positive integer. Therefore:
a(n) = a(n mod 100) + (d(100) + a(floor(n/100) mod 10))*[floor(n/100) mod 10 > 0] + Sum_{k=1..oo} (d(10^(2k+1)) + a(floor(n/(10^(2k+1))) mod 100))*[floor(n/(10^(2k+1))) mod 100 > 0] where [] is the Iverson bracket and d() is the number of letters in a place-value word.
d(100) = 2, d(10^3) = 4, d(10^5) = 3, d(10^7) = 4, d(10^9) = 3, d(10^11) = 3, d(10^13) = 3, d(10^15) = 3, d(10^17) = 3.
In another popular convention: a vowel, or a consonant is one letter; a consonant diacritic is half a letter; a conjunct consonant is half a letter plus half as many letters as the consonants conjuncted; and a vowel diacritic, a nasal diacritic, a nuqta, a halant, or a space is not a letter. These rules change the sequence to: 2.5, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 3.5, 3, 3, 3, 3, 3, 3.5, 4, 3.5, 2, ...
(End)

Crossrefs

Cf. A005589.

Extensions

Links added by N. J. A. Sloane, Jun 20 2008
Offset 0 from Sangeet Paul, May 27 2019
a(21)-a(86) from Sangeet Paul, May 29 2019

A125587 Call an n X n matrix robust if the top left i X i submatrix is invertible for all i = 1..n. Sequence gives number of n X n robust real {0,1}-matrices.

Original entry on oeis.org

1, 4, 68, 5008, 1603232, 2224232640
Offset: 1

Author

Keywords

Comments

An upper bound is the total number of {0,1}-matrices, 2^(n^2).
Comment from Michael Kleber, Jan 05 2006: A lower bound is 2^(n^2-n), A053763. For given the principal n-1 X n-1 submatrix A, the 2n-2 further entries (excluding the bottom right corner) can be filled in arbitrarily and then there is always at least one choice for the last entry which makes the matrix invertible.
Comment from N. J. A. Sloane, Jan 06 2006: Let the matrix be [A b; c d], where A is n-1 X n-1, b is n-1 X 1, c is 1 X n-1, d is 0 or 1. The matrix is singular iff d = c A^(-1) b, which for given A, b, c has at most one solution d.
Suppose A = identity, as in A125586. Then if d=0 there are 3^(n-1) choices for b and c, while if d=1 there are (n-1)*3^(n-2) choices for b and c. This proves the formula in A125586.

Examples

			a(2) = 4 from:
10 10 11 11
01 11 01 10
		

Crossrefs

Extensions

a(5) and a(6) from Brendan McKay, Jan 06 2007

A125586 a(n) = 2^(2n-1) - (n+2)*3^(n-2).

Original entry on oeis.org

1, 4, 17, 74, 323, 1400, 6005, 25478, 107015, 445556, 1841273, 7561922, 30897227, 125714672, 509767421, 2061390206, 8317305359, 33498803948, 134727010049, 541232563130, 2172291241811, 8712410196584, 34922863258757, 139921580805494, 560408087592983
Offset: 1

Author

Keywords

Comments

Number of n X n nonsingular real matrices with entries {0,1} in which the top left n-1 X n-1 submatrix is the identity matrix. See A125587 for proof.
The number of singular matrices is given by A006234.

Examples

			a(2) = 4:
10 10 11 11
01 11 01 10
		

Crossrefs

Programs

Formula

G.f.: -x*(10*x^2-6*x+1) / ((3*x-1)^2*(4*x-1)). - Colin Barker, Feb 26 2014

A118131 Profile of a woman, after Jean-Pierre David.

Original entry on oeis.org

0, 93, 94, 98, 102, 104, 110, 107, 111, 116, 119, 118, 121, 122, 123, 123, 124, 125, 125, 125, 124, 126, 126, 126, 125, 130, 131, 132, 134, 134, 136, 137, 139, 139, 140, 141, 142, 143, 143, 145, 146, 146, 147, 147, 148, 148, 148, 149, 150, 150
Offset: 0

Author

Keywords

Comments

This sequence is a demonstration of the "graph" program. Click the "graph" button and look at the second figure.

A115520 Number of ordered triples (i,j,k) in range [0..n] satisfying i == j mod 2 and j == k mod 3.

Original entry on oeis.org

1, 2, 5, 12, 23, 36, 61, 88, 123, 170, 227, 288, 373, 462, 565, 688, 827, 972, 1153, 1340, 1547, 1782, 2039, 2304, 2617, 2938, 3285, 3668, 4079, 4500, 4981, 5472, 5995, 6562, 7163, 7776, 8461, 9158, 9893, 10680, 11507, 12348, 13273, 14212, 15195, 16238, 17327, 18432, 19633
Offset: 0

Author

Keywords

Crossrefs

Cf. A115523.

Formula

a(n) = binomial(n+1,3) - linear (PORC) correction term which depends on n mod 6.

A115523 Number of ordered quadruples (i,j,k,l) in range [0..n] satisfying i == j (mod 2), j == k (mod 3) and k == l (mod 4).

Original entry on oeis.org

1, 2, 5, 12, 33, 60, 111, 176, 287, 440, 637, 864, 1237, 1652, 2147, 2752, 3555, 4428, 5517, 6700, 8177, 9878, 11785, 13824, 16441, 19214, 22265, 25676, 29685, 33900, 38715, 43776, 49595, 55964, 62821, 69984, 78445, 87248, 96647, 106800, 118167, 129948, 142905, 156332
Offset: 0

Author

Keywords

Comments

Quasipolynomial of order 12. - Charles R Greathouse IV, Dec 03 2014

Crossrefs

Programs

  • PARI
    a(n)=my(s);for(i=0,n,forstep(j=i%2,n,2,forstep(k=j%3,n,3,s+=(n-(k%4))\4+1)));s \\ naive; Charles R Greathouse IV, Dec 03 2014

Formula

a(n) = binomial(n+1,4) - presumably quadratic (PORC) correction term which depends on n mod 24.
From Charles R Greathouse IV, Dec 03 2014: (Start)
n == 0 (mod 12): a(n) = (n^4 + 4*n^3 + 12*n^2 + 24*n + 24)/24
n == 1 (mod 12): a(n) = (n^4 + 4*n^3 + 12*n^2 + 20*n + 11)/24
n == 2 (mod 12): a(n) = (n^4 + 4*n^3 + 10*n^2 + 12*n + 8)/24
n == 3 (mod 12): a(n) = (n^4 + 4*n^3 + 8*n^2 + 8*n + 3)/24
n == 4 (mod 12): a(n) = (n^4 + 4*n^3 + 12*n^2 + 20*n + 8)/24
n == 5 (mod 12): a(n) = (n^4 + 4*n^3 + 10*n^2 + 12*n + 5)/24
n == 6 (mod 12): a(n) = (n^4 + 4*n^3 + 12*n^2 + 12*n )/24
n == 7 (mod 12): a(n) = (n^4 + 4*n^3 + 8*n^2 + 8*n + 3)/24
n == 8 (mod 12): a(n) = (n^4 + 4*n^3 + 10*n^2 + 12*n + 8)/24
n == 9 (mod 12): a(n) = (n^4 + 4*n^3 + 12*n^2 + 12*n + 3)/24
n == 10 (mod 12): a(n) = (n^4 + 4*n^3 + 12*n^2 + 8*n + 8)/24
n == 11 (mod 12): a(n) = (n^4 + 4*n^3 + 6*n^2 + 4*n + 1)/24
(End)
a(n) = (19958400*(n^4+4*n^3+12*n^2+24*n+24) - (1235*n^2+2*1127*n+215)*m^11 +(74987*n^2+2*69047*n+13541)*m^10 -(1983300*n^2+2*1844700*n+377520)*m^9 +(29983800*n^2+2*28201800*n+6115890)*m^8 - (285731655*n^2+2*272034411*n+63415275)*m^7 +(1784142591*n^2+2*1720539051*n+436295013)*m^6 -(7344548530*n^2+2*7175131810*n+1995595030)*m^5 +(19515989350*n^2+2*19301456350*n+5911801060)*m^4 -(31672473360*n^2+2*31658103312*n+10685562360)*m^3 +(27907182072*n^2+2*28127231352*n+10490664096)*m^2 -(9932634720*n^2+2*10110299040*n+4359398400)*m)/479001600 where m=n-12*floor(n/12). - Luce ETIENNE, Sep 27 2017

A100708 Differences arising in A100707.

Original entry on oeis.org

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

Author

N. J. A. Sloane and Vinay Vaishampayan, Dec 10 2004

Keywords

Programs

  • Haskell
    a100708 n = a100708_list !! (n-1)
    a100708_list = map abs $ zipWith (-) (tail a100707_list) a100707_list
    -- Reinhard Zumkeller, Jul 19 2013

Formula

a(n) = abs(A100707(n+1) - A100707(n)). - Reinhard Zumkeller, Jul 19 2013

Extensions

Missing a(46) = 46 inserted by Reinhard Zumkeller, Jul 19 2013

A100707 a(1) = 1; for n > 1, a(n+1)=a(n)-k if there exists a positive number k (take the smallest) that has not yet been used and is such that a(n+1) is new and >0, otherwise a(n+1) = a(n)+k if the same conditions are satisfied.

Original entry on oeis.org

1, 2, 4, 7, 3, 8, 14, 6, 13, 22, 12, 23, 11, 24, 10, 25, 9, 26, 5, 27, 45, 21, 40, 20, 43, 18, 44, 17, 46, 16, 47, 19, 51, 15, 48, 82, 42, 77, 39, 76, 37, 78, 36, 79, 35, 80, 34, 81, 33, 83, 32, 84, 31, 85, 30, 86, 29, 87, 38, 97, 28, 88, 149, 75, 137, 74
Offset: 1

Author

Keywords

Comments

A sequence of distinct natural numbers with the property that absolute successive differences are distinct.
A more long-winded definition: start with a(1) = 1. We keep a list of the numbers k that have been used as differences so far; initially this list is empty. Each difference can be used at most once.
Suppose a(n) = M. To get a(n+1), we subtract from M each number k < M that has not yet been used, starting from the smallest. If for any such k, M-k is a number not yet in the sequence, set a(n+1) = M-k and mark the difference k as used.
If no k works, then we add each number k that has not yet been used to M, again starting with the smallest. When we find a k such that M+k is a number not yet in the sequence, we set a(n+1) = M+k and mark k as used. Repeat.
The main question is: does every number appear in the sequence?
A227617(n) = smallest m such that a(m) = n: if this sequence is a permutation of the natural numbers, then A227617 is its inverse. - Reinhard Zumkeller, Jul 19 2013

Examples

			1 -> 1+1 = 2 and k=1 has been used as a difference.
2 -> 2+4 = 4 and k=2 has been used as a difference.
4 could go to 4-3 = 1, except that 1 has already appeared in the sequence; so 4 -> 4+3 = 7 and k=3 has been used as a difference.
7 -> 7-4 = 3 (for the first time we can subtract) and k=4 has been used as a difference. And so on.
		

Crossrefs

Similar to Murthy's sequence A093903, Cald's sequence (A006509) and Recamán's sequence A005132. See also A081145, A100709 (another version). Cf. A100708 (the successive differences associated with this sequence).

Programs

  • Haskell
    import Data.List (delete)
    import qualified Data.Set as Set (insert)
    import Data.Set (singleton, member)
    a100707 n = a100707_list !! (n-1)
    a100707_list = 1 : f 1 (singleton 1) [1..] where
       f y st ds = g ds where
         g (k:ks) | v <= 0      = h ds
                  | member v st = g ks
                  | otherwise   = v : f v (Set.insert v st) (delete k ds)
                  where v = y - k
         h (k:ks) | member w st = h ks
                  | otherwise   = w : f w (Set.insert w st) (delete k ds)
                  where w = y + k
    -- Reinhard Zumkeller, Jul 19 2013

Extensions

Data corrected for n > 46 by Reinhard Zumkeller, Jul 19 2013