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-2 of 2 results.

A343726 Squares with exactly one even digit.

Original entry on oeis.org

0, 4, 16, 25, 36, 49, 81, 121, 169, 196, 361, 529, 576, 729, 961, 1156, 1369, 1521, 1936, 3136, 3721, 3969, 5329, 5776, 5929, 7396, 7569, 7921, 15129, 15376, 17161, 17956, 19321, 31329, 35721, 51529, 53361, 57121, 59536, 97969, 111556, 113569, 119716, 131769
Offset: 1

Views

Author

Jon E. Schoenfield, May 19 2021

Keywords

Comments

The even digit is always one of the last two digits.
The only squares with no digits even are the one-digit odd squares 1 and 9.

Crossrefs

Programs

  • Maple
    q:= n-> (l-> is(add(i mod 2, i=l)=nops(l)-1))(convert(n, base, 10)):
    select(q, [i^2$i=0..400])[];  # Alois P. Heinz, May 22 2021
  • Mathematica
    Select[Range[0, 400]^2, Count[IntegerDigits[#], ?EvenQ] == 1 &] (* _Amiram Eldar, May 21 2021 *)
  • PARI
    isA343726(n) = if(issquare(n) && (n!=0), my(d=digits(n)); #d - vecsum(d%2) == 1, n==0) \\ Jianing Song, May 22 2021
  • Python
    def ok(sq): return sum(d in "02468" for d in str(sq)) == 1
    def aupto(limit):
      sqs = (i*i for i in range(int(limit**.5)+2) if i*i <= limit)
      return list(filter(ok, sqs))
    print(aupto(131769)) # Michael S. Branicky, May 20 2021
    

Formula

Intersection of A000290 and A118070.

A381699 a(n) is the least nontrivial multiple of 2*n with the least possible number of even digits.

Original entry on oeis.org

4, 8, 12, 16, 30, 36, 56, 32, 36, 40, 110, 72, 52, 56, 90, 96, 136, 72, 76, 80, 336, 132, 92, 96, 150, 156, 378, 112, 116, 120, 310, 192, 132, 136, 350, 576, 370, 152, 156, 160, 574, 336, 172, 176, 990, 552, 376, 192, 196, 300, 510, 312, 318, 756, 330, 336, 570, 1392, 354, 360, 732, 372, 378
Offset: 1

Views

Author

Ali Sada and M. F. Hasler, Mar 04 2025

Keywords

Comments

By nontrivial multiple, we mean a multiple strictly larger than the number.
For even numbers, the last digit of any multiple will always be even. Also, for multiples of 10^k, all multiples will always have at least k even digits, namely k trailing '0's. Thus, if the number is a multiple of 2*10^k, there will be at least k+1 trailing even digits.
Question: if n is even, but not a multiple of 10, is there always a multiple k*n for which the last digit is the only even digit? If not, what is the smallest counterexample?
Records values of k(n) = a(n)/2n are k(1) = 2, k(5) = 3, k(7) = 4, k(11) = 5, k(21) = 8, k(45) = 11, k(58) = 12, k(101) = 55, k(182) = 108, k(1001) = 555, k(2001) = 778, k(3996) = 1001, k(7992) = 3253, k(9091) = 21545, k(9901) = 161155, ...

Examples

			a(4) = 16 is the least nontrivial multiple of 8 with only one even digit.
a(5) = 30 is the least nontrivial multiple of 10 with only one even digit.
a(10) = 40 because 40 is the least nontrivial multiple of 20, and all multiples of 20 will always have (at least) the last two digits even.
a(41) = 574 is the least positive multiple of 82 that has only one even digit.
		

Crossrefs

Cf. A061808 (similar for odd numbers), A061807.
Cf. A118070 (numbers with exactly one even decimal digit).

Programs

  • PARI
    apply( {A381699(n, o=valuation(5*n*=2,10))=for(k=2, oo, #[0|d<-digits(n*k)%2, !d]>o|| return(k*n))}, [1..99]) \\ M. F. Hasler, Mar 04 2025
Showing 1-2 of 2 results.