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: Freddy Barrera

Freddy Barrera's wiki page.

Freddy Barrera has authored 8 sequences.

A371862 Positive integers that can be written as the product of two or more other integers, none of which uses any of the digits in the number itself.

Original entry on oeis.org

4, 6, 8, 9, 10, 12, 14, 16, 18, 20, 21, 24, 27, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 49, 52, 54, 56, 57, 58, 60, 63, 64, 66, 68, 69, 70, 72, 76, 78, 80, 81, 84, 86, 87, 88, 90, 96, 98, 99, 100, 102, 104, 106, 108, 110, 111, 112, 114, 116, 117, 118, 120
Offset: 1

Author

Keywords

Comments

Infinite since 10^k = 2^k * 5^k and 10^k - 1 = 3^2 * (10^k - 1)/9 are terms for k > 0 and are the smallest (k+1)-digit and largest k-digit terms, resp. All repdigits consisting of 4's, 6's, 8's, or 9's are also terms. - Michael S. Branicky, Apr 09 2024
No number ending in 5 is a term. - Jon E. Schoenfield, Apr 09 2024
Terms are composite. If 9 consecutive positive integers are terms then they are between two consecutive primes at least 14 apart. - David A. Corneth, Apr 10 2024
All products of x (repdigits consisting of 3's or 6's) and 10x + 7 are terms. - Ivan N. Ianakiev, Apr 11 2024

Examples

			60 is a term because it can be expressed as 4 * 15, avoiding its own digits 6 and 0. 50 isn't because there is no way of expressing 50 avoiding both 5 and 0.
112 is a term since 112 = 4*4*7 and is the first term requiring a product with three factors.
		

Crossrefs

Programs

  • Python
    from sympy import divisors, isprime
    from functools import cache
    @cache
    def ok(n, avoid=tuple()):
        if avoid == tuple(): avoid = set(str(n))
        else: avoid = set(avoid)
        if n%10 == 5 or len(avoid) == 10 or isprime(n): return False
        for d in divisors(n)[1:-1]:
            if set(str(d)) & avoid == set():
                if set(str(n//d)) & avoid == set(): return True
                if ok(n//d, tuple(sorted(avoid))): return True
        return False
    print([k for k in range(200) if ok(k)]) # Michael S. Branicky, Apr 10 2024

A357474 Squarely correct numbers.

Original entry on oeis.org

1, 4, 9, 11, 14, 16, 19, 25, 36, 41, 44, 49, 64, 81, 91, 94, 99, 100, 111, 114, 116, 119, 121, 125, 136, 141, 144, 149, 161, 164, 169, 181, 191, 194, 196, 199, 225, 251, 254, 256, 259, 289, 324, 361, 364, 369, 400, 411, 414, 416, 419, 425, 436, 441, 444, 449, 464
Offset: 1

Author

Freddy Barrera, Sep 29 2022

Keywords

Comments

A positive integer is a squarely correct number if its base-10 representation consists entirely of one or more adjacent blocks of digits that are positive perfect squares with no leading zeros. (See George Berzsenyi link below.)

Examples

			14401 is not a term, but 14411 is.
		

Crossrefs

Programs

  • PARI
    is(n)=if(n<11, issquare(n), n%10, my(d=digits(n)); for(i=1,#d, if(issquare(n%10^i) && d[#d+1-i] && is(n\10^i), return(1))); 0, my(k=valuation(n,10)); k%2==0 && is(n/10^k)) \\ Charles R Greathouse IV, Oct 04 2022
  • Python
    from sympy.ntheory.primetest import is_square
    def ok(n):
        if is_square(n): return True
        s = str(n)
        return any(s[i]!="0" and ok(int(s[:i])) and ok(int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(1, 465) if ok(k)]) # Michael S. Branicky, Oct 03 2022
    

Formula

5n/3 < a(n) << n^k for n > 1, where k = log 10/log 3 = 2.0959.... - Charles R Greathouse IV, Oct 03 2022

A348300 a(n) is the largest number that is the digit sum of the square of an n-digit number.

Original entry on oeis.org

13, 31, 46, 63, 81, 97, 112, 130, 148, 162, 180, 193, 211, 229, 244, 262, 277, 297, 310, 331, 343, 360, 378, 396
Offset: 1

Author

Keywords

Comments

18*n-a(n) appears to be nondecreasing. - Chai Wah Wu, Nov 18 2021
According to new data 18*n-a(n) sometimes decreases. - David A. Corneth, Feb 21 2024
a(n) is the digit sum of the square of the last n-digit integer in A067179. - Zhao Hui Du, Mar 04 2024
a(n) appears to be approximately equal to 16.5*n. - Zhining Yang, Mar 12 2024
a(n) modulo 9 is either 0, 1, 4 or 7. - Chai Wah Wu, Apr 04 2024

Examples

			a(3) = 46 because 46 is the largest digital sum encountered among the squares (that of 937) of all 3-digit numbers. Such maximal digital sum can be achieved by more than one square (squares of 836 and 883 also have digital sum 46). Largest of these is A348303.
		

Crossrefs

Programs

  • Mathematica
    Array[Max@ Map[Total@ IntegerDigits[#^2] &, Range[10^(# - 1), 10^# - 1]] &, 8] (* Michael De Vlieger, Oct 12 2021 *)
  • Python
    def A348300(n): return max(sum(int(d) for d in str(m**2)) for m in range(10**(n-1),10**n)) # Chai Wah Wu, Jun 26 2024
  • Sage
    def A348300(n):
        return max(sum((k^2).digits()) for k in (10^(n-1)..10^n-1))
    

Formula

a(n) = Max_{k=10^(n-1)..10^n-1} A004159(k).

Extensions

a(11) from Chai Wah Wu, Nov 18 2021
a(12)-a(13) from Martin Ehrenstein, Nov 20 2021
a(14)-a(24) from Zhao Hui Du, Feb 23 2024
Name edited by Jon E. Schoenfield, Mar 10 2024

A348303 a(n) is the largest n-digit number whose square has a digital sum equal to A348300(n).

Original entry on oeis.org

7, 83, 937, 9417, 94863, 987917, 9893887, 99483667, 994927133, 9486778167, 99497231067, 999949483667, 9892825177313
Offset: 1

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[#1 + Position[#2, Max[#2]][[-1, -1]] - 1 & @@ {#1, Map[Total@ IntegerDigits[#^2] &, Range[#1, #2]]} & @@ {10^(# - 1), 10^# - 1} &, 8] (* Michael De Vlieger, Oct 12 2021 *)

Extensions

a(11) from Chai Wah Wu, Nov 18 2021
a(12)-a(13) from Martin Ehrenstein, Nov 20 2021

A340486 Number of unlabeled graphs on n vertices whose independence number is equal to clique number.

Original entry on oeis.org

1, 0, 2, 3, 8, 54, 380, 3462, 83606, 4822240
Offset: 1

Author

Freddy Barrera, Jan 09 2021

Keywords

Examples

			a(3) = 2 because, of the four graphs of order three, only the path graph and its complement have equal independence and clique number, 2 in this case.
		

A306841 Number of rectangles of integer sides whose area or perimeter is n.

Original entry on oeis.org

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

Author

Freddy Barrera, Mar 12 2019

Keywords

Examples

			a(4) = 3 because there are two rectangles of integer sides of area 4 (2 X 2 and 1 X 4) and one rectangle of integer sides of perimeter 4 (1 X 1).
		

Crossrefs

Cf. A038548 (area n), A004526 (perimeter 2n).

Formula

a(n) = ceiling(d(n)/2) + floor(n/4) if n is even, a(n) = ceiling(d(n)/2) otherwise, where d(n) is the number of divisors of n.

A306488 Number of ways of expressing n as a + b + c, with a, b, and c positive integers, gcd(a, b) = 1, but gcd(a, c) and gcd(b, c) both greater than 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 0, 9, 0, 7, 1, 4, 1, 15, 0, 13, 1, 4, 2, 16, 0, 24, 4, 10, 1, 29, 0, 32, 4, 5, 3, 41, 0, 38, 2, 17, 6, 54, 1, 43, 6, 26, 10, 70, 0, 65, 9, 20, 11, 68, 1, 86, 14, 35, 2, 99, 1, 99, 15, 18, 16, 104, 1, 125, 10, 53, 19, 134, 0, 114, 21, 58
Offset: 0

Author

Freddy Barrera, Feb 18 2019

Keywords

Examples

			a(11) = 1 because of the ten partitions of 11 into three parts, only 6 + 3 + 2 satisfies the conditions. But a(210) = 0, because 210 does not have any partition that satisfies the conditions.
		

References

  • F. Barrera, B. Recamán and S. Wagon, Problem 12044, Amer. Math. Monthly 125 (2018), p. 466.

Programs

  • Mathematica
    a[n_] := Length@ Select[ IntegerPartitions[ n, {3}], (t = Sort[GCD @@@ Subsets[#, {2}]]; t[[1]] == 1 && t[[2]] > 1 && t[[3]] > 1) &]; a /@ Range[0, 87] (* Giovanni Resta, Feb 20 2019 *)
  • Sage
    def a(n):
        if n < 3: return 0
        r = 0
        t = [False, True, True]
        for p in Partitions(n, length=3, min_part=2, max_slope=-1):
            s = sorted(gcd(a, b) > 1 for a, b in Subsets(p, 2))
            r += int(s == t)
        return r
    [a(n) for n in (0..100)]

A261573 A variation of Recamán's sequence A005132: Define a(0) = 0, and for n > 0, a(n) = a(n-1) - (n+2) if positive and not already in the sequence, otherwise a(n) = a(n-1) + (n+2).

Original entry on oeis.org

0, 3, 7, 2, 8, 1, 9, 18, 28, 17, 5, 18, 4, 19, 35, 52, 34, 15, 35, 14, 36, 13, 37, 12, 38, 11, 39, 10, 40, 71, 103, 70, 104, 69, 33, 70, 32, 71, 31, 72, 30, 73, 29, 74, 120, 167, 119, 168, 118, 67, 119, 66, 120, 65, 121, 64, 6, 65, 125, 186, 124, 61, 125, 60, 126, 59, 127, 58, 128, 57
Offset: 0

Author

Freddy Barrera, Aug 24 2015

Keywords

Comments

As in Recamán's sequence, terms are repeated, the first being 18 = a(7) = a(11).
More generally, for k >= 0, a_k(0) = 0, and for n > 0, a_k(n) = a_k(n-1) - (n+k) if positive and not already in the sequence, otherwise a_k(n) = a_k(n-1) + (n+k).
For k = 0, this is Recamán's sequence A005132.

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{a = s[[-1]], len = Length@ s}, Append[s, If[a > len + 1 && ! MemberQ[s, a - len - 2], a - len - 2, a + len + 2]]]; Nest[f, {0}, 70] (* Robert G. Wilson v, Sep 08 2015 *)
  • Python
    def sequence(n, k):
        """For n > 0 and k >= 0, generates the first n terms of the sequence"""
        A, a = {0}, 0
        yield a
        for n in range(1, n + 1):
            a = a - (n + k)
            if a > 0 and a not in A:
                A.add(a)
                yield a
            else:
                a = a + 2 * (n + k)
                A.add(a)
                yield a
    # List of the first 1000 terms of the sequence with k = 2.
    list(sequence(1000, 2))