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

A030477 Numbers k such that k^2 has property that all even digits occur together and all odd digits occur together.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 17, 18, 20, 21, 22, 24, 25, 28, 29, 30, 32, 34, 38, 40, 42, 44, 45, 47, 49, 51, 53, 56, 58, 60, 62, 65, 67, 68, 72, 76, 78, 79, 80, 83, 86, 88, 91, 92, 93, 98, 100, 102, 108, 118, 120, 122, 124, 132, 134, 138, 140
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A030476.

Programs

  • Maple
    filter:= proc(n) local L,x,m;
      L:= convert(n^2,base,10) mod 2;
      if n::odd then
        if not member(0,L,m) then return true fi;
        convert(L[m..-1],set) = {0}
      else
        if not member(1,L,m) then return true fi;
        convert(L[m..-1],set) = {1}
      fi
    end proc:
    select(filter, [$0..1000]); # Robert Israel, Oct 27 2024
  • Python
    def ok(n):
        s = "".join("0" if d in "02468" else "1" for d in str(n**2))
        return len(set(s.rstrip(s[-1]))) < 2
    print([k for k in range(141) if ok(k)]) # Michael S. Branicky, Oct 27 2024

A030475 Primes with property that all even digits occur together and all odd digits occur together.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 311, 313, 317
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L; L:= convert(n,base,10) mod 2;
      not member(-1,L[1..-2]-L[2..-1])
    end proc:
    select(filter, [seq(ithprime(i),i=1..1000)]);
  • Mathematica
    With[{upto=100},Select[Prime[Range[upto]],Length[SplitBy[IntegerDigits[#],Mod[#,2]&]]<3&]] (* Paolo Xausa, Oct 18 2023 *)

Extensions

Offset changed by Robert Israel, Oct 17 2023

A030480 Primes with property that when squared all even digits occur together and all odd digits occur together.

Original entry on oeis.org

2, 3, 5, 7, 17, 29, 47, 53, 67, 79, 83, 149, 151, 157, 257, 283, 457, 653, 683, 907, 1429, 1571, 1693, 1699, 2017, 2459, 2467, 2543, 2609, 2617, 2843, 2879, 2909, 2971, 4759, 5101, 5179, 5333, 6653, 6803, 6947, 6949, 7759, 8297, 9091, 9103
Offset: 1

Views

Author

Keywords

Comments

Primes whose squares have at most one odd digit. - Robert Israel, Oct 17 2023

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
      if not isprime(n) then return false fi;
      convert(convert(n^2,base,10)[2..-1] mod 2,set) = {0};
    end proc:
    filter(2):= true: filter(3):= true:
    select(filter, [2,seq(i,i=3..10000,2)]); # Robert Israel, Oct 17 2023
  • Mathematica
    With[{upto=10^4},Select[Prime[Range[upto]],Count[IntegerDigits[#^2],?OddQ]<2&]] (* _Paolo Xausa, Oct 18 2023 *)

Extensions

Offset changed by Robert Israel, Oct 17 2023
Showing 1-3 of 3 results.