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.

A263194 4-digit numbers (with leading zeros supplied where necessary) in which the sum of the number consisting of the first two digits and the number consisting of the last two digits equals the number consisting of the middle two digits.

This page as a plain text file.
%I A263194 #29 Jan 25 2021 20:15:01
%S A263194 0,109,110,219,220,329,330,439,440,549,550,659,660,769,770,879,880,
%T A263194 989,990,1208,1318,1428,1538,1648,1758,1868,1978,2307,2417,2527,2637,
%U A263194 2747,2857,2967,3406,3516,3626,3736,3846,3956,4505,4615,4725,4835,4945,5604,5714,5824,5934,6703,6813,6923,7802,7912,8901
%N A263194 4-digit numbers (with leading zeros supplied where necessary) in which the sum of the number consisting of the first two digits and the number consisting of the last two digits equals the number consisting of the middle two digits.
%C A263194 0 can be a leading digit.
%D A263194 George Bredehorn, The Giant Book of Puzzles, Main Street, 2013, page 12.
%H A263194 Aresh Pourkavoos, <a href="http://mathtician.weebly.com/an-integer-sequence.html">Website with C code to generate sequence</a>
%F A263194 The sequence contains stretches where, for some n, a(n) - a(n-1) = 110.
%e A263194 Since 19 + 78 = 97, 1978 is a term.
%t A263194 fQ[n_] := Block[{d = PadLeft[IntegerDigits@ n, 4]}, FromDigits@ d[[1 ;; 2]] + FromDigits@ d[[3 ;; 4]] == FromDigits@ d[[2 ;; 3]]]; Select[Range[0, 10^4 - 1], fQ] (* _Michael De Vlieger_, Oct 26 2015 *)
%o A263194 (C)
%o A263194 #include <stdio.h>
%o A263194 int main(){
%o A263194   int e = 10; // what base we are using: experiment with different values (values above 10 do not work well)
%o A263194   for (int a = 0; a < e; a++){ // I know these nested loops are inelegant, but they're the easiest way
%o A263194     for (int b = 0; b < e; b++){
%o A263194       for (int c = 0; c < e; c++){
%o A263194         for (int d = 0; d < e; d++){
%o A263194           if ((10*a)+b+(10*c)+d == (10*b)+c){ // if the number formed by the first two digits plus the number formed by the last two digits equals the number formed by the middle two digits
%o A263194             if (e <= 10){
%o A263194             printf("%d%d%d%d, ", a, b, c, d); // print the number
%o A263194             }
%o A263194             else{
%o A263194             printf("%d %d %d %d,  ", a, b, c, d); // print the number with extra spaces
%o A263194             }
%o A263194           }
%o A263194         }
%o A263194       }
%o A263194     }
%o A263194   }
%o A263194   printf("\n");
%o A263194   return 0;
%o A263194 }
%o A263194 (PARI) is(n) = n < 10000 && n%100 + n \ 100 == (n \ 10) % 100 \\ _David A. Corneth_, Oct 14 2017
%o A263194 (Python)
%o A263194 def ok(n): return (n//100) + (n%100) == (n//10)%100
%o A263194 print([m for m in range(10000) if ok(m)]) # _Michael S. Branicky_, Jan 25 2021
%Y A263194 Cf. A293686.
%K A263194 base,easy,fini,full,nonn
%O A263194 1,2
%A A263194 _Aresh Pourkavoos_, Oct 11 2015