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: Glen Gilchrist

Glen Gilchrist's wiki page.

Glen Gilchrist has authored 7 sequences.

A359982 Numbers whose digits are distinct nonprimes and are not a permutation of a smaller such number.

Original entry on oeis.org

0, 1, 4, 6, 8, 9, 10, 14, 16, 18, 19, 40, 46, 48, 49, 60, 68, 69, 80, 89, 90, 104, 106, 108, 109, 146, 148, 149, 168, 169, 189, 406, 408, 409, 468, 469, 489, 608, 609, 689, 809, 1046, 1048, 1049, 1068, 1069, 1089, 1468, 1469, 1489, 1689, 4068, 4069, 4089, 4689, 6089, 10468, 10469, 10489, 10689, 14689, 40689, 104689
Offset: 1

Author

Glen Gilchrist, Jan 20 2023

Keywords

Comments

The sequence consists of numbers constructed from the combination of the six nonprime digits 0,1,4,6,8,9 without duplication of the digits. Hence there are 2^6 - 1 = 63 terms.

Examples

			10 is in the sequence as both 1 and 0 are nonprime, all digits are distinct, and no permutation of those digits yields a smaller number (with no leading 0's).
14 is in the sequence as both 1 and 4 are nonprime, all digits are distinct, and no permutation of those digits yields a smaller number.
41 is not in the sequence as 14 is a permutation of its digits and is a smaller number.
189 is in the sequence, so its permutations 198, 819, 891, 918 and 981, all of which are larger, are not.
104689 is in the sequence as all digits are nonprime and distinct, and no permutation of those digits yields a smaller number (with no leading 0's).
		

Crossrefs

Cf. A062115 (no prime substring), A124673 (distinct prime digits).

Programs

  • Maple
    sort(map(x-> parse(cat(`if`(nops(x)>1 and x[1]=0,
    [x[2], x[1], x[3..-1][]], x)[])), [seq(combinat[choose]
    ([0, 1, 4, 6, 8, 9], i)[], i=1..6)]))[];  # Alois P. Heinz, Jan 27 2023
  • Python
    import itertools
    nums, combinations, flat_list = [0,1,4,6,8,9],[],[]
    for r in range(len(nums)+1):
        for combination in itertools.combinations(nums, r):
          combinations.append(list(combination))
    for var in range(len(combinations)):
        subitems=""
        if (len(combinations[var]) > 1 and combinations[var][0] == 0) :
          combinations[var][0], combinations[var][1] = combinations[var][1], combinations[var][0]
        for sub in combinations[var]:
            subitems += str(sub)
            flat_list.append(int(subitems))
    print(sorted(set(flat_list)))

A344474 Least number k such that half of the numbers from 0 to k inclusive contain the digit n.

Original entry on oeis.org

1, 1, 2915, 39365, 472391, 590489, 6377291, 7440173, 8503055, 9565937
Offset: 0

Author

Glen Gilchrist, May 20 2021

Comments

"Half-numbers" are those for which half of the numbers including and preceding it contain a specific digit.
For each digit there are a finite number of nonnegative integers k such that exactly half of the numbers from 0 to k contain the digit. This sequence gives the first of these.

Examples

			a(0)=1 since among the numbers 0,1 exactly half contain a digit "0" and 1 is the smallest number where this occurs.
a(1)=1 since among the numbers 0,1 exactly half contain a digit "1" and 1 is the smallest number where this occurs.
a(2)=2915 since among the numbers 0,1,2,...,2915 exactly half contain a digit "2" and 2915 is the smallest number where this occurs.
a(3)=39365 since among the numbers 0,1,2,...,39365 exactly half contain a digit "3" and 39365 is the smallest number where this occurs.
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Cf. A016189, A344634 (half-zero sequence), A344636 (half-one sequence).

Programs

  • PARI
    a(n)={if(n>=1&&n<10, my(k=0); while(n*(2*9^k-10^k)>10^k, k++); 2*9^k*n - 1, n==0)} \\ Andrew Howroyd, May 25 2021
  • Python
    for z in range (0, 10):
        z_s = str(z)
        counts=0
        for x in range (0,1000000000):
            x_s = str(x)
            if z_s in x_s:
                counts += 1
            if counts / (x+1) == 0.5:
                print(x)
                break
    

Formula

a(n) == 1457 (mod 1458) for n >= 2. - Hugo Pfoertner, May 25 2021

A344634 Numbers k such that half the numbers from 0 to k inclusive contain the digit "0".

Original entry on oeis.org

1, 10761677, 14958585, 14960717, 14961735, 15013205, 15588833, 15590573, 15591959, 15591961, 15592031, 15592229, 15592231, 15603695, 15633495, 15633503, 15633517, 16076087, 16263743, 20327615
Offset: 1

Author

Glen Gilchrist, May 25 2021

Keywords

Comments

Andrew Hilton (see Ref.) refers to these as "half-zero" numbers.

Examples

			1 is a term since among the numbers 0,1 exactly half contain a digit "0".
10761677 is a term since among the numbers 0,1,2,...,10761677 exactly half contain a digit "0".
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Programs

  • Python
    def afind(limit):
      count0 = [0, 1]
      for k in range(1, limit+1):
        count0['0' in str(k)] += 1
        if count0[0] == count0[1]: print(k, end=", ")
    afind(3*10**7) # Michael S. Branicky, May 25 2021

A344636 Numbers k such that half the numbers from 0 to k inclusive contain the digit "1".

Original entry on oeis.org

1, 17, 23, 161, 269, 271, 1457, 3397, 3419, 3421, 13121, 44685, 118097, 674909, 674933, 1062881
Offset: 1

Author

Glen Gilchrist, May 25 2021

Keywords

Comments

Andrew Hilton (see Ref) refers to these as "half-one" numbers.

Examples

			1 is a term since among the numbers 0,1 exactly half contain a digit "1".
17 is a term since among the numbers 0,1,2,...,17 exactly half contain a digit "1".
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Programs

  • Mathematica
    Select[2Range@2000,Length@Select[Range[0,#-1],MemberQ[IntegerDigits@#,1]&]==#/2&]-1 (* Giorgos Kalogeropoulos, Jul 28 2021 *)

A340559 Numbers that are palindromic in base 2 and base 16.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 15, 17, 51, 85, 119, 153, 255, 257, 273, 771, 819, 1285, 1317, 1365, 1397, 1799, 1831, 1879, 1911, 2313, 2409, 2457, 2553, 3855, 3951, 3999, 4095, 4097, 4369, 12291, 13107, 20485, 21029, 21845, 22389, 28679, 29223, 30039, 30583, 36873, 38505
Offset: 1

Author

Glen Gilchrist, Jan 11 2021

Keywords

Crossrefs

Intersection of A006995 and A029730.

Programs

  • Mathematica
    Select[Range[0, 10^5], PalindromeQ @ IntegerDigits[#, 2] && PalindromeQ @ IntegerDigits[#, 16]  &] (* Amiram Eldar, Jan 11 2021 *)
  • PARI
    ispal(m, b) = my(d=digits(m, b)); d == Vecrev(d);
    isok(m) = ispal(m, 2) && ispal(m, 16); \\ Michel Marcus, Jan 20 2021
  • Python
    def palindrome(x):
        res = str(x) == str(x)[::-1]
        return res
    def dec_to_bin(x):
        return int(bin(x)[2:])
    def dec_to_hex(x):
        return (hex(x)[2:])
    for x in range (1,10000):
        if palindrome(dec_to_hex(x)) & palindrome(dec_to_bin(x)) == True:
              print(x)
    (BASIC:- MM Basic, a modern QBASIC variant, https://www.mmbasic.com/)
    Function reverse(in_string$) As string
      Local r$
      Local i
      For i = Len(in_string$) To 1 Step -1
          b$=Mid$(in_string$,i,1)
          r$=r$+b$
      Next i
      reverse=r$
    End Function
    For i = 1 To 10000
      If Bin$(i) = reverse(Bin$(i)) Then
          If Hex$(i) = reverse(Hex$(i)) Then
              Print i,Bin$(i), Hex$(i)
          EndIf
      EndIf
    Next i
    

A337510 a(n) = Sum_{k=0..n} T(n,k) where T(n,k) = (T(n-1, k-1) + T(n-1,k))^2.

Original entry on oeis.org

1, 2, 6, 52, 3854, 21090612, 629815387162156, 561871511512925116799625359336, 446575758106416254441837050759254156476271759098752411181598
Offset: 0

Author

Glen Gilchrist, Aug 30 2020

Keywords

Comments

Based on Pascal's triangle A007318 by additionally squaring the sum of each term generated. For example, in Pascal, n=3 gives 1,2,1. Here n=3 gives, 1^2, (1+1)^2, 1^2 = 1+4+1.

Examples

			1 = 1
1 + 1 = 2
1 + (1 + 1)^2  + 1 = 1 + 4 + 1 = 6
1 + (1 + 4)^2  + (4 + 1)^2 + 1 = 1 + 25 + 25 + 1 = 52
1 + (1 + 25)^2 + (25 + 25)^2 + (25 + 1)^2 + 1 = 1 + 676 + 2500 + 676 + 1 = 3854.
		

Crossrefs

Programs

  • Python
    def r(i):
      t = [[0, 1, 0], [0, 1, 1, 0]]
      for n in range(2, i+1):
        t.append([0])
        for k in range(1, n+2):
          t[n].append((t[n-1][k-1] + t[n-1][k])**2)
        t[n].append(0)
      return(sum(t[i]))

Formula

a(n) = Sum_{k=0..n} T(n,k) where T(n,k) = (T(n-1,k-1) + T(n-1,k))^2; T(0,0)=1; T(n,-1):=0; T(n,k):=0, n < k.

A307481 Numbers that can be expressed as x+2y+z such that x, y, z, x+y, y+z, and x+2y+z are all positive squares.

Original entry on oeis.org

625, 2500, 5625, 10000, 15625, 22500, 28561, 30625, 40000, 50625, 62500, 75625, 83521, 90000, 105625, 114244, 122500, 140625, 142129, 160000, 180625, 202500, 225625, 250000, 257049, 275625, 302500, 330625, 334084, 360000, 390625, 422500, 455625, 456976, 490000, 525625
Offset: 1

Author

Glen Gilchrist, Apr 10 2019

Keywords

Comments

Generated by iterating through all combinations of x,y,z in the range 1..5000 (squared) and completing the addition pyramid (see Example section).
If k is in the sequence then so is k*m^2 for m >= 1. - David A. Corneth, May 04 2019
If a^2 + b^2 = c^2 then x = a^4, y = (ab)^2, z = b^4 gives a term x + 2y + z = c^4. - David A. Corneth, May 07 2019

Examples

			Each addition pyramid is built up from three numbers x, y, and z as follows:
.
       x+2y+z
         / \
        /   \
      x+y   y+z
      / \   / \
     /   \ /   \
    x     y     z
.
The first two terms, a(1)=625 and a(2)=2500, are the apex values for the first two pyramids consisting entirely of squares:
.
         625                   2500
         / \                    / \
        /   \                  /   \
      225   400              900  1600
      / \   / \              / \   / \
     /   \ /   \            /   \ /   \
    81   144   256        324   576  1024
		

Crossrefs

Cf. A000290 (squares).

Programs

  • Magma
    a:=[]; for sw in [1..725] do w:=sw^2; for su in [1..Isqrt(w div 2)] do u:=su^2; v:=w-u; if IsSquare(v) then for sx in [1..Isqrt(u)] do x:=sx^2; y:=u-x; if (y gt 0) and IsSquare(y) then z:=v-y; if IsSquare(z) then a[#a+1]:=w; break su; end if; end if; end for; end if; end for; end for; a; // Jon E. Schoenfield, May 07 2019
    (C++) See Links section.