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-10 of 24 results. Next

A355147 Triangle read by rows: T(n,k) is the number of product-free subsets of {1,...,n} with cardinality k; n >= 0, 0 <= k <= A028391(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 4, 5, 2, 1, 5, 9, 6, 1, 1, 6, 14, 15, 7, 1, 1, 7, 20, 29, 22, 8, 1, 1, 8, 26, 43, 38, 17, 3, 1, 9, 34, 68, 76, 47, 15, 2, 1, 10, 43, 102, 144, 123, 62, 17, 2, 1, 11, 53, 143, 234, 238, 149, 55, 11, 1, 1, 12, 64, 196, 377, 472, 387, 204, 66, 12, 1
Offset: 0

Views

Author

Marcel K. Goh, Jun 28 2022

Keywords

Comments

S is product-free if for any i,j in S, not necessarily distinct, i*j is not in S.
For n >= 2, the alternating row sums give 0.

Examples

			Triangle T(n,k) begins:
  n/k 0  1  2   3   4   5   6  7  8 9
   0  1
   1  1
   2  1  1
   3  1  2  1
   4  1  3  2
   5  1  4  5   2
   6  1  5  9   6   1
   7  1  6 14  15   7   1
   8  1  7 20  29  22   8   1
   9  1  8 26  43  38  17   3
  10  1  9 34  68  76  47  15  2
  11  1 10 43 102 144 123  62 17  2
  12  1 11 53 143 234 238 149 55 11 1
  ...
For n=5 and k=3 the T(5,3) = 2 sets are {2,3,5} and {3,4,5}.
		

Crossrefs

Row sums give A326489.
Cf. A028391.

A000196 Integer part of square root of n. Or, number of positive squares <= n. Or, n appears 2n+1 times.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10
Offset: 0

Views

Author

Keywords

Comments

Also the integer part of the geometric mean of the divisors of n. - Amarnath Murthy, Dec 19 2001
Number of numbers k (<= n) with an odd number of divisors. - Benoit Cloitre, Sep 07 2002
Also, for n > 0, the number of digits when writing n in base where place values are squares, cf. A007961; A190321(n) <= a(n). - Reinhard Zumkeller, May 08 2011
The least monotonic left inverse of squares, A000290. That is, the lexicographically least nondecreasing sequence a(n) such that a(A000290(n)) = n. - Antti Karttunen, Oct 06 2017

Examples

			G.f. = x + x^2 + x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 2*x^7 + 2*x^8 + 3*x^9 + ...
		

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 73, problem 23.
  • Lionel Levine, Fractal sequences and restricted Nim, Ars Combin. 80 (2006), 113-127.
  • Paul J. McCarthy, Introduction to Arithmetical Functions, Springer Verlag, 1986, p. 28.
  • N. J. A. Sloane and Allan Wilks, On sequences of Recaman type, paper in preparation, 2006.

Crossrefs

Programs

  • Haskell
    import Data.Bits (shiftL, shiftR)
    a000196 :: Integer -> Integer
    a000196 0 = 0
    a000196 n = newton n (findx0 n 1) where
       -- find x0 == 2^(a+1), such that 4^a <= n < 4^(a+1).
       findx0 0 b = b
       findx0 a b = findx0 (a `shiftR` 2) (b `shiftL` 1)
       newton n x = if x' < x then newton n x' else x
                    where x' = (x + n `div` x) `div` 2
    a000196_list = concat $ zipWith replicate [1,3..] [0..]
    -- Reinhard Zumkeller, Apr 12 2012, Oct 23 2010
    
  • Julia
    a(n) = isqrt(n) # Paul Muljadi, Jun 03 2024
  • Magma
    [Isqrt(n) : n in [0..100]];
    
  • Maple
    Digits := 100; A000196 := n->floor(evalf(sqrt(n)));
  • Mathematica
    Table[n, {n, 0, 20}, {2n + 1}] //Flatten (* Zak Seidov Mar 19 2011 *)
    IntegerPart[Sqrt[Range[0, 110]]] (* Harvey P. Dale, May 23 2012 *)
    Floor[Sqrt[Range[0, 99]]] (* Alonso del Arte, Dec 31 2013 *)
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, x]  - 1) / (2 (1 - x)), {x, 0, n}]; (* Michael Somos, May 28 2014 *)
  • PARI
    {a(n) = if( n<0, 0, sqrtint(n))};
    
  • Python
    # from http://code.activestate.com/recipes/577821-integer-square-root-function/
    def A000196(n):
      if n < 0:
        raise ValueError('only defined for nonnegative n')
      if n == 0:
        return 0
      a, b = divmod(n.bit_length(), 2)
      j = 2**(a+b)
      while True:
        k = (j + n//j)//2
        if k >= j:
          return j
        j = k
    print([A000196(n)for n in range(102)])
    # Jason Kimberley, Nov 09 2016
    
  • Python
    from math import isqrt
    def a(n): return isqrt(n)
    print([a(n) for n in range(102)]) # Michael S. Branicky, Feb 15 2023
    
  • Scheme
    ;; The following implementation uses higher order function LEFTINV-LEASTMONO-NC2NC from my IntSeq-library. It returns the least monotonic left inverse of any strictly growing function (see the comment-section for the definition) and although it does not converge as fast to the result as many specialized integer square root algorithms, at least it does not involve any floating point arithmetic. Thus with correctly implemented bignums it will produce correct results even with very large arguments, in contrast to just taking the floor of (sqrt n).
    ;; Source of LEFTINV-LEASTMONO-NC2NC can be found under https://github.com/karttu/IntSeq/blob/master/src/Transforms/transforms-core.ss and the definition of A000290 is given under that entry.
    (define A000196 (LEFTINV-LEASTMONO-NC2NC 0 0 A000290)) ;; Antti Karttunen, Oct 06 2017
    

Formula

a(n) = Card(k, 0 < k <= n such that k is relatively prime to core(k)) where core(x) is the squarefree part of x. - Benoit Cloitre, May 02 2002
a(n) = a(n-1) + floor(n/(a(n-1)+1)^2), a(0) = 0. - Reinhard Zumkeller, Apr 12 2004
From Hieronymus Fischer, May 26 2007: (Start)
a(n) = Sum_{k=1..n} A010052(k).
G.f.: g(x) = (1/(1-x))*Sum_{j>=1} x^(j^2) = (theta_3(0, x) - 1)/(2*(1-x)) where theta_3 is a Jacobi theta function. (End)
a(n) = floor(A000267(n)/2). - Reinhard Zumkeller, Jun 27 2011
a(n) = floor(sqrt(n)). - Arkadiusz Wesolowski, Jan 09 2013
Sum_{n>0} 1/a(n)^s = 2*zeta(s-1) + zeta(s), where zeta is the Riemann zeta function. - Enrique Pérez Herrero, Oct 15 2013
From Wesley Ivan Hurt, Dec 31 2013: (Start)
a(n) = Sum_{i=1..n} (A000005(i) mod 2), n > 0.
a(n) = (1/2)*Sum_{i=1..n} (1 - (-1)^A000005(i)), n > 0. (End)
a(n) = sqrt(A048760(n)), n >= 0. - Wolfdieter Lang, Mar 24 2015
a(n) = Sum_{k=1..n} floor(n/k)*lambda(k) = Sum_{m=1..n} Sum_{d|m} lambda(d) where lambda(j) is Liouville lambda function, A008836. - Geoffrey Critzer, Apr 01 2015
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, May 02 2023

A028392 a(n) = n + floor(sqrt(n)).

Original entry on oeis.org

0, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 0

Views

Author

Keywords

Comments

A171746 gives number of iterations to reach a square. - Reinhard Zumkeller, Oct 14 2010
From Carmine Suriano, Oct 15 2010: (Start)
Also the sequence of integers left after performing the following procedure:
1. Remove the element at 1st position (1) and compact the sequence;
2. Remove the element at 4th (2^2-th) position (5) and compact the sequence;
3. Remove the element at 9th (3^2-th) position (11) and compact the sequence;
....
n. Remove the element at (n-square)th position (n^2 + n - 1) and compact the sequence;
(End)

Examples

			G.f. = 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 7*x^5 + 8*x^6 + 9*x^7 + 10*x^8 + 12*x^9 + ...
		

Crossrefs

Complement of A028387.
Cf. A000196. - Reinhard Zumkeller, Oct 14 2010

Programs

Formula

a(n) = 2*n - A028391(n).
G.f.: x / (1 - x)^2 + (theta3(x) - 1) / (2 * (1 - x)). - Michael Somos, Mar 24 2012

A135668 a(n) = ceiling(n + sqrt(n)).

Original entry on oeis.org

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

Views

Author

Mohammad K. Azarian, Nov 25 2007

Keywords

Comments

Complement of A002061. - Kieren MacMillan, Dec 16 2007

Crossrefs

Programs

  • Magma
    [Ceiling(n + n^(1/2)): n in [1..100]]; // Vincenzo Librandi, Feb 16 2013
    
  • Mathematica
    Table[Ceiling[n + n^(1/2)], {n, 100}] (* Vincenzo Librandi, Feb 16 2013 *)
  • Python
    from sympy import integer_nthroot
    def A135668(n): return n+(a:=integer_nthroot(n,2))[0]+(not a[1]) # Chai Wah Wu, Aug 26 2024

A135671 a(n) = ceiling(n - n^(2/3)).

Original entry on oeis.org

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

Views

Author

Mohammad K. Azarian, Nov 25 2007

Keywords

Crossrefs

Programs

Extensions

Offset corrected by Mohammad K. Azarian, Nov 19 2008

A135672 a(n) = floor(n - n^(2/3)).

Original entry on oeis.org

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

Views

Author

Mohammad K. Azarian, Nov 25 2007

Keywords

Crossrefs

Programs

Extensions

Offset corrected by Mohammad K. Azarian, Nov 19 2008

A372306 Cardinality of the largest subset of {1,...,n} such that no three distinct elements of this subset multiply to a square.

Original entry on oeis.org

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

Views

Author

Terence Tao, May 25 2024

Keywords

Comments

a(n) >= A373114(n).
a(n) ~ n (Erdős-Sárközy-Sós).
a(n+1)-a(n) is either 0 or 1 for any n.
If "three" is replaced by "two" one obtains A013928. If "three" is replaced by "one", one obtains A028391. If "three" is replaced by "any odd", one obtains A373114.

Examples

			a(7)=6, because the set {1,2,3,4,5,7} has no three distinct elements multiplying to a square, but {1,2,3,4,5,6,7} has 2*3*6 = 6^2.
		

Crossrefs

Programs

  • PARI
    \\ See PARI link
  • Python
    from math import isqrt
    def is_square(n):
        return isqrt(n) ** 2 == n
    def valid_subset(A):
        length = len(A)
        for i in range(length):
            for j in range(i + 1, length):
                for k in range(j + 1, length):
                    if is_square(A[i] * A[j] * A[k]):
                        return False
        return True
    def largest_subset_size(N):
        from itertools import combinations
        max_size = 0
        for size in range(1, N + 1):
            for subset in combinations(range(1, N + 1), size):
                if valid_subset(subset):
                    max_size = max(max_size, size)
        return max_size
    for N in range(1, 11):
        print(largest_subset_size(N))
    
  • Python
    from math import prod
    from functools import lru_cache
    from itertools import combinations
    from sympy.ntheory.primetest import is_square
    @lru_cache(maxsize=None)
    def A372306(n):
        if n==1: return 1
        i = A372306(n-1)+1
        if sum(1 for p in combinations(range(1,n),2) if is_square(n*prod(p))) > 0:
            a = [set(p) for p in combinations(range(1,n+1),3) if is_square(prod(p))]
            for q in combinations(range(1,n),i-1):
                t = set(q)|{n}
                if not any(s<=t for s in a):
                    return i
            else:
                return i-1
        else:
            return i # Chai Wah Wu, May 30 2024
    

Formula

From David A. Corneth, May 29 2024: (Start)
a(k^2) = a(k^2 - 1) for k >= 3.
a(p) = a(p - 1) + 1 for prime p. (End)

Extensions

a(18)-a(36) from Michael S. Branicky, May 25 2024
a(37)-a(38) from Michael S. Branicky, May 26 2024
a(39)-a(63) from Martin Ehrenstein, May 26 2024
a(64)-a(76) from David A. Corneth, May 29 2024, May 30 2024

A135673 Ceiling(n + n^(2/3)).

Original entry on oeis.org

2, 4, 6, 7, 8, 10, 11, 12, 14, 15, 16, 18, 19, 20, 22, 23, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 82, 83
Offset: 1

Views

Author

Mohammad K. Azarian, Nov 25 2007

Keywords

Examples

			a(6) = 10; ceiling(6 + 6^(2/3)) = ceiling(9.30192...) = 10.
		

Crossrefs

Programs

Extensions

More terms from Wesley Ivan Hurt, Nov 01 2013

A135674 Floor(n+n^(2/3)).

Original entry on oeis.org

2, 3, 5, 6, 7, 9, 10, 12, 13, 14, 15, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 74
Offset: 1

Views

Author

Mohammad K. Azarian, Nov 25 2007

Keywords

Crossrefs

Programs

A373119 Cardinality of the largest subset of {1,...,n} such that no four distinct elements of this subset multiply to a square.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 22, 22, 22, 22, 23, 23, 24, 24, 24, 24, 25, 25, 26, 26, 26
Offset: 1

Views

Author

Terence Tao, May 26 2024

Keywords

Comments

a(n) >= A000720(n).
a(n) ~ n/log n (Erdős-Sárközy-Sós). Best bounds currently are due to Pach-Vizer.
a(n+1)-a(n) is either 0 or 1 for any n. (Is equal to 1 when n+1 is prime.)
If "four" is replaced by "one", "two", "three", "five", or "any odd", one obtains A028391, A013928, A372306, A373178, and A373114 respectively.

Examples

			a(7)=6, because the set {1,2,3,4,5,7} has no four distinct elements multiplying to a square, but {1,2,3,4,5,6,7} has 1*2*3*6 = 6^2.
		

Crossrefs

Lower bounded by A000720.

Programs

  • Python
    from math import isqrt
    def is_square(n):
        return isqrt(n) ** 2 == n
    def valid_subset(A):
        length = len(A)
        for i in range(length):
            for j in range(i + 1, length):
                for k in range(j + 1, length):
                    for l in range(k + 1, length):
                        if is_square(A[i] * A[j] * A[k] * A[l]):
                            return False
        return True
    def largest_subset_size(N):
        from itertools import combinations
        for size in reversed(range(1, N + 1)):
            for subset in combinations(range(1, N + 1), size):
                if valid_subset(subset):
                    return size
    for N in range(1, 23):
        print(largest_subset_size(N))
    
  • Python
    from math import prod
    from functools import lru_cache
    from itertools import combinations
    from sympy.ntheory.primetest import is_square
    @lru_cache(maxsize=None)
    def A373119(n):
        if n==1: return 1
        i = A373119(n-1)+1
        if sum(1 for p in combinations(range(1,n),3) if is_square(n*prod(p))) > 0:
            a = [set(p) for p in combinations(range(1,n+1),4) if is_square(prod(p))]
            for q in combinations(range(1,n),i-1):
                t = set(q)|{n}
                if not any(s<=t for s in a):
                    return i
            else:
                return i-1
        else:
            return i # Chai Wah Wu, May 30 2024

Extensions

a(22)-a(37) from Michael S. Branicky, May 26 2024
a(38)-a(63) from Martin Ehrenstein, May 27 2024
a(64)-a(69) from Jinyuan Wang, Dec 30 2024
Showing 1-10 of 24 results. Next