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: Jonathan Schwartz

Jonathan Schwartz's wiki page.

Jonathan Schwartz has authored 5 sequences.

A290934 a(n) equals the sum of the squares of the digits of A254958(n).

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 49, 64, 81, 25, 25, 100, 100, 9, 81, 81, 9, 9, 49, 36, 49, 121, 121, 49, 49, 81, 81, 36, 36, 81, 81, 81, 144, 49, 121, 49, 81, 81, 121, 121, 121, 81, 121, 81, 81, 144, 144, 121, 121, 4, 36, 36, 100, 25, 25, 36, 100, 36, 100, 25, 49, 36, 36
Offset: 1

Author

Jonathan Schwartz, Aug 14 2017

Keywords

Crossrefs

Programs

  • Java
    import java.util.ArrayList;public class Seq {public static void main(String[] args) {int l = 1000;
    ArrayList squares = new ArrayList();
    for (int i = 1; i <= l; i++) {squares.add((i * i));}
    int term = 1;
    for (int n = 1; n < Integer.MAX_VALUE; n++) {
    if (!(Integer.toString(n).contains("0")))
    if (squares.contains(sum(n))){
    int k = 0;
    for(int i = 0;i1000)break;}}
    static int sum(int n) {int s = 0;String str = Integer.toString(n);for (int i = 0; i < str.length(); i++) {s += (Integer.valueOf(Character.toString(str.charAt(i)))*Integer.valueOf(Character.toString(str.charAt(i))));}return s;}}
    
  • Mathematica
    Select[Map[Total, Select[Array[IntegerDigits, 1550], FreeQ[#, 0] &]^2], IntegerQ@ Sqrt@ # &] (* Michael De Vlieger, Aug 15 2017 *)
  • PARI
    lista(nn) = {for (n=1, nn, d = digits(n); if (vecmin(d) && issquare(s=sum(k=1, #d, d[k]^2)), print1(s, ", ")););} \\ Michel Marcus, Aug 28 2017

A289552 Zeroless pandigital numbers (each digit 1-9 used exactly once) where the first 3 digits plus the next 3 digits equals the last 3 digits.

Original entry on oeis.org

124659783, 125739864, 127359486, 127368495, 128367495, 128439567, 129357486, 129438567, 129654783, 129735864, 134658792, 135729864, 138429567, 138654792, 139428567, 139725864, 142596738, 142695837, 143586729, 145692837, 146583729, 146592738, 152487639, 152784936
Offset: 1

Author

Jonathan Schwartz, Aug 02 2017

Keywords

Examples

			124659783: 124 + 659 = 783.
		

Crossrefs

Programs

  • Java
    import java.util.*;public class Sequence{public static void main(String[] args) {
    for (long i = 123456789l; i < 987654321l; i++)
    {Set set = new HashSet();String number = Long.toString(i);
    if (!(number.contains("0"))) {
    for (int n = 0; n < 9; n++) {set.add(number.charAt(n));}
    if (set.size() == 9){
    if(Integer.valueOf(number.substring(0,3))+Integer.valueOf(number.substring(3,6))==Integer.valueOf(number.substring(6,9)))
    {System.out.print(i + ", ");}}}}}}
    
  • Mathematica
    FromDigits/@Select[Permutations[Range[9]],FromDigits[Take[#,3]]+FromDigits[ Take[ #,{4,6}]] == FromDigits[Take[#,-3]]&] (* Harvey P. Dale, Oct 18 2022 *)
  • Python
    from itertools import permutations
    def t2i(t): return int("".join(map(str, t)))
    alst = [t2i(p) for p in permutations(range(1, 10)) if t2i(p[:3]) + t2i(p[3:6]) == t2i(p[6:])]
    print(alst) # Michael S. Branicky, May 30 2022

A286846 Zeroless pandigital (9-digit) numbers where the first three digits minus the middle three digits equals the last three digits.

Original entry on oeis.org

459173286, 459176283, 459183276, 459186273, 459273186, 459276183, 459283176, 459286173, 468173295, 468175293, 468193275, 468195273, 468273195, 468275193, 468293175, 468295173, 486127359, 486129357, 486157329, 486159327, 486327159, 486329157, 486357129
Offset: 1

Author

Jonathan Schwartz, Aug 01 2017

Keywords

Examples

			459173286: 459 - 173 = 286.
		

Crossrefs

A subsequence of A290725.

Programs

  • Java
    import java.util.*; public class GenerateSequence {public static void main(String[] args) { Set seq = new TreeSet(); for (long i = 123456789l; i < 987654321; i++) {Set set = new HashSet(); String number = Long.toString(i);if (!(number.contains("0"))) {for (int n = 0; n < 9; n++){set.add(number.charAt(n));} if (set.size() == 9) {if (Integer.valueOf(number.substring(0, 3)) - Integer.valueOf(number.substring(3, 6)) == Integer.valueOf(number.substring(6, 9))) { seq.add(i);} } } System.out.println(seq); } }
    
  • Mathematica
    FromDigits/@Select[Permutations[Range[9]],FromDigits[Take[#,3]]-FromDigits[ Take[ #,{4,6}]]==FromDigits[Take[#,-3]]&] (* Harvey P. Dale, Aug 08 2020 *)
  • Python
    from itertools import permutations
    def t2i(t): return int("".join(map(str, t)))
    alst = [t2i(p) for p in permutations(range(1, 10)) if t2i(p[:3]) - t2i(p[3:6]) == t2i(p[6:])]
    print(alst) # Michael S. Branicky, May 30 2022

A289544 Pandigital numbers (each digit 0-9 used exactly once) where the first 3 digits plus the next 3 digits equals the last 4 digits.

Original entry on oeis.org

2467891035, 2497861035, 2647891053, 2697841053, 2847691053, 2867491035, 2897461035, 2897641053, 3247651089, 3257641089, 3427561098, 3467521098, 3478591206, 3498571206, 3527461098, 3567421098, 3578491206, 3598471206, 3647251089, 3657241089, 4236751098, 4256731098
Offset: 1

Author

Jonathan Schwartz, Aug 02 2017

Keywords

Comments

Leading zeros in the last four digits are not included, else 1246590783, with 124 + 659 = 783 would be the first term.

Examples

			2467891035 is in the sequence as 246|789|1035: 246 + 789 = 1035 and each digit (0-9) is used exactly once.
		

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Select[Permutations[Range[0, 9]], And[#1 + #2 == #3, #3 >= 1000] & @@ Map[FromDigits, {Take[#, 3], #[[4 ;; 6]], Take[#, -4]}] &] (* Michael De Vlieger, Aug 02 2018 *)
  • Python
    from itertools import permutations
    def t2i(t): return int("".join(map(str, t)))
    alst = [t2i(p) for p in permutations(range(10)) if p[6] != 0 and t2i(p[:3]) + t2i(p[3:6]) == t2i(p[6:])]
    print(alst) # Michael S. Branicky, May 30 2022

A286845 Every 3-digit number 'a' such that there exist two other 3-digit numbers, 'b' and 'c', such that a - b = c, and a,b,c collectively use every digit 1-9 exactly once.

Original entry on oeis.org

459, 468, 486, 495, 549, 567, 576, 594, 639, 648, 657, 675, 693, 729, 738, 783, 792, 819, 837, 846, 864, 873, 891, 918, 927, 936, 945, 954, 963, 972, 981
Offset: 1

Author

Jonathan Schwartz, Aug 01 2017

Keywords

Comments

For example, 459 - 173 = 286 and 459173286 is a zeroless pandigital number.

Programs

  • Java
    import java.util.*; public class GenerateSequence {public static void main(String[] args) { Set seq = new TreeSet();
    for (long i = 987654321l; i > 123456789; i--) {Set set = new HashSet(); String number = Long.toString(i);
    if (!(number.contains("0"))) {for (int n = 0; n < 9; n++){set.add(number.charAt(n));}
    if (set.size() == 9) {
    if (Integer.valueOf(number.substring(0, 3)) - Integer.valueOf(number.substring(3, 6)) == Integer.valueOf(number.substring(6, 9))) { seq.add(Integer.valueOf(number.substring(0, 3)));} } } System.out.println(seq); } }
  • Mathematica
    With[{s = Select[Range[#/9, #] &[10^3 - 1], DigitCount[#, 10, 0] == 0 &]}, Select[s, Function[n, AnyTrue[s, Function[k, And[n - k > 0, FreeQ[#, i_ /; i == 0], Length@ # == 9] &@ Union@ Apply[Join, IntegerDigits@ {n, k, n - k}]]]]]] (* Michael De Vlieger, Aug 01 2017 *)