login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1
0, 109, 110, 219, 220, 329, 330, 439, 440, 549, 550, 659, 660, 769, 770, 879, 880, 989, 990, 1208, 1318, 1428, 1538, 1648, 1758, 1868, 1978, 2307, 2417, 2527, 2637, 2747, 2857, 2967, 3406, 3516, 3626, 3736, 3846, 3956, 4505, 4615, 4725, 4835, 4945, 5604, 5714, 5824, 5934, 6703, 6813, 6923, 7802, 7912, 8901 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

0 can be a leading digit.

REFERENCES

George Bredehorn, The Giant Book of Puzzles, Main Street, 2013, page 12.

LINKS

Table of n, a(n) for n=1..55.

Aresh Pourkavoos, Website with C code to generate sequence

FORMULA

The sequence contains stretches where, for some n, a(n) - a(n-1) = 110.

EXAMPLE

Since 19 + 78 = 97, 1978 is a term.

MATHEMATICA

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 *)

PROG

(C)

#include <stdio.h>

int main(){

  int e = 10; // what base we are using: experiment with different values (values above 10 do not work well)

  for (int a = 0; a < e; a++){ // I know these nested loops are inelegant, but they're the easiest way

    for (int b = 0; b < e; b++){

      for (int c = 0; c < e; c++){

        for (int d = 0; d < e; d++){

          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

            if (e <= 10){

            printf("%d%d%d%d, ", a, b, c, d); // print the number

            }

            else{

            printf("%d %d %d %d,  ", a, b, c, d); // print the number with extra spaces

            }

          }

        }

      }

    }

  }

  printf("\n");

  return 0;

}

(PARI) is(n) = n < 10000 && n%100 + n \ 100 == (n \ 10) % 100 \\ David A. Corneth, Oct 14 2017

(Python)

def ok(n): return (n//100) + (n%100) == (n//10)%100

print([m for m in range(10000) if ok(m)]) # Michael S. Branicky, Jan 25 2021

CROSSREFS

Cf. A293686.

Sequence in context: A130705 A253431 A253438 * A231701 A051046 A196667

Adjacent sequences:  A263191 A263192 A263193 * A263195 A263196 A263197

KEYWORD

base,easy,fini,full,nonn

AUTHOR

Aresh Pourkavoos, Oct 11 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 27 12:49 EDT 2022. Contains 354097 sequences. (Running on oeis4.)